mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
move clean_path_on_failure out of each hook install
This commit is contained in:
parent
0224be8194
commit
d05b7888ab
15 changed files with 277 additions and 312 deletions
|
|
@ -12,7 +12,6 @@ from pre_commit.envcontext import Var
|
|||
from pre_commit.hook import Hook
|
||||
from pre_commit.languages import helpers
|
||||
from pre_commit.prefix import Prefix
|
||||
from pre_commit.util import clean_path_on_failure
|
||||
from pre_commit.util import cmd_output_b
|
||||
|
||||
ENVIRONMENT_DIR = 'swift_env'
|
||||
|
|
@ -46,14 +45,13 @@ def install_environment(
|
|||
)
|
||||
|
||||
# Build the swift package
|
||||
with clean_path_on_failure(directory):
|
||||
os.mkdir(directory)
|
||||
cmd_output_b(
|
||||
'swift', 'build',
|
||||
'-C', prefix.prefix_dir,
|
||||
'-c', BUILD_CONFIG,
|
||||
'--build-path', os.path.join(directory, BUILD_DIR),
|
||||
)
|
||||
os.mkdir(directory)
|
||||
cmd_output_b(
|
||||
'swift', 'build',
|
||||
'-C', prefix.prefix_dir,
|
||||
'-c', BUILD_CONFIG,
|
||||
'--build-path', os.path.join(directory, BUILD_DIR),
|
||||
)
|
||||
|
||||
|
||||
def run_hook(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue