Added pre-commit installation to windows deployment script
This commit is contained in:
parent
575b214c8e
commit
a5ce373cbf
|
@ -9,6 +9,21 @@ param(
|
||||||
[Bool]
|
[Bool]
|
||||||
$agents = $true
|
$agents = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
function Configure-precommit([String] $python_command)
|
||||||
|
{
|
||||||
|
Write-Output "Installing pre-commit and setting up pre-commit hook"
|
||||||
|
python -m pip install pre-commit
|
||||||
|
if ($LastExitCode) {
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
pre-commit install
|
||||||
|
if ($LastExitCode) {
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
Write-Output "Pre-commit successfully installed"
|
||||||
|
}
|
||||||
|
|
||||||
function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName, [String] $branch = "develop")
|
function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName, [String] $branch = "develop")
|
||||||
{
|
{
|
||||||
Write-Output "Downloading to $monkey_home"
|
Write-Output "Downloading to $monkey_home"
|
||||||
|
@ -119,6 +134,8 @@ function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName,
|
||||||
$scoutsuiteRequirements = Join-Path -Path $monkey_home -ChildPath $SCOUTSUITE_DIR | Join-Path -ChildPath "\requirements.txt"
|
$scoutsuiteRequirements = Join-Path -Path $monkey_home -ChildPath $SCOUTSUITE_DIR | Join-Path -ChildPath "\requirements.txt"
|
||||||
& python -m pip install --user -r $scoutsuiteRequirements
|
& python -m pip install --user -r $scoutsuiteRequirements
|
||||||
|
|
||||||
|
Configure-precommit
|
||||||
|
|
||||||
$user_python_dir = cmd.exe /c 'py -m site --user-site'
|
$user_python_dir = cmd.exe /c 'py -m site --user-site'
|
||||||
$user_python_dir = Join-Path (Split-Path $user_python_dir) -ChildPath "\Scripts"
|
$user_python_dir = Join-Path (Split-Path $user_python_dir) -ChildPath "\Scripts"
|
||||||
if (!($ENV:Path | Select-String -SimpleMatch $user_python_dir))
|
if (!($ENV:Path | Select-String -SimpleMatch $user_python_dir))
|
||||||
|
|
Loading…
Reference in New Issue