From 1cc2dc24ac198479c44e0b6ad16084eaddb1c301 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 7 Apr 2021 14:39:36 +0300 Subject: [PATCH] Fixed pre-commit to be installer in monkey dir during deployment scripts --- deployment_scripts/deploy_windows.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deployment_scripts/deploy_windows.ps1 b/deployment_scripts/deploy_windows.ps1 index bc781b546..28d34904c 100644 --- a/deployment_scripts/deploy_windows.ps1 +++ b/deployment_scripts/deploy_windows.ps1 @@ -10,9 +10,10 @@ param( $agents = $true ) -function Configure-precommit([String] $python_command) +function Configure-precommit([String] $git_repo_dir) { Write-Output "Installing pre-commit and setting up pre-commit hook" + Push-Location $git_repo_dir python -m pip install pre-commit if ($LastExitCode) { exit @@ -21,6 +22,7 @@ function Configure-precommit([String] $python_command) if ($LastExitCode) { exit } + Pop-Location Write-Output "Pre-commit successfully installed" } @@ -134,7 +136,7 @@ function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName, $scoutsuiteRequirements = Join-Path -Path $monkey_home -ChildPath $SCOUTSUITE_DIR | Join-Path -ChildPath "\requirements.txt" & python -m pip install --user -r $scoutsuiteRequirements - Configure-precommit + Configure-precommit($monkey_home) $user_python_dir = cmd.exe /c 'py -m site --user-site' $user_python_dir = Join-Path (Split-Path $user_python_dir) -ChildPath "\Scripts"