From 1117294b333ec2226a651c75b1d197762e8a5073 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 2 Feb 2021 17:58:57 +0100 Subject: [PATCH] fix cwd on windows --- tools/create_env.ps1 | 4 +++- tools/create_zip.ps1 | 4 +++- tools/make_docs.ps1 | 2 ++ tools/run_settings.ps1 | 3 ++- tools/run_tray.ps1 | 2 ++ tools/update_submodules.ps1 | 9 ++++++++- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tools/create_env.ps1 b/tools/create_env.ps1 index b096d0bddc..1c5e6e35e6 100644 --- a/tools/create_env.ps1 +++ b/tools/create_env.ps1 @@ -46,6 +46,8 @@ function Install-Poetry() { $current_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $current_dir).parent.FullName +Set-Location -Path $pype_root + $art = @" @@ -117,6 +119,6 @@ if (-not (Test-Path -PathType Leaf -Path "$($pype_root)\poetry.lock")) { Write-Host "Updating virtual environment." & poetry update } - +Set-Location -Path $current_dir Write-Host ">>> " -NoNewline -ForegroundColor green Write-Host "Virtual environment created. " \ No newline at end of file diff --git a/tools/create_zip.ps1 b/tools/create_zip.ps1 index 8390d42135..ee8da5acec 100644 --- a/tools/create_zip.ps1 +++ b/tools/create_zip.ps1 @@ -35,6 +35,7 @@ function Show-PSWarning() { $current_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $current_dir).parent.FullName +Set-Location -Path $pype_root $art = @" @@ -93,4 +94,5 @@ Write-Host "Generating zip from current sources ..." Write-Host "... " -NoNewline -ForegroundColor Magenta Write-Host "arguments: " -NoNewline -ForegroundColor Gray Write-Host $ARGS -ForegroundColor White -& poetry run python "$($pype_root)\start.py" generate-zip $ARGS \ No newline at end of file +& poetry run python "$($pype_root)\start.py" generate-zip $ARGS +Set-Location -Path $current_dir \ No newline at end of file diff --git a/tools/make_docs.ps1 b/tools/make_docs.ps1 index 1476bdb30a..8ce991d5bb 100644 --- a/tools/make_docs.ps1 +++ b/tools/make_docs.ps1 @@ -16,6 +16,8 @@ PS> .\make_docs.ps1 $current_dir = Get-Location $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $script_dir).parent.FullName +Set-Location -Path $pype_root + $art = @" diff --git a/tools/run_settings.ps1 b/tools/run_settings.ps1 index 3cf513e5de..48ea9befdf 100644 --- a/tools/run_settings.ps1 +++ b/tools/run_settings.ps1 @@ -13,5 +13,6 @@ PS> .\run_settings.ps1 $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $script_dir).parent.FullName - +Set-Location -Path $pype_root & poetry run python "$($pype_root)\start.py" settings --dev +Set-Location -Path $current_dir \ No newline at end of file diff --git a/tools/run_tray.ps1 b/tools/run_tray.ps1 index ebd504d7a8..2c7a665fcf 100644 --- a/tools/run_tray.ps1 +++ b/tools/run_tray.ps1 @@ -12,5 +12,7 @@ PS> .\run_tray.ps1 #> $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $pype_root = (Get-Item $script_dir).parent.FullName +Set-Location -Path $pype_root & poetry run python "$($pype_root)\start.py" tray --debug +Set-Location -Path $current_dir \ No newline at end of file diff --git a/tools/update_submodules.ps1 b/tools/update_submodules.ps1 index 0793889a5c..22792ff6da 100644 --- a/tools/update_submodules.ps1 +++ b/tools/update_submodules.ps1 @@ -35,4 +35,11 @@ function Exit-WithCode($exitcode) { exit $exitcode } -git submodule update --recursive --remote \ No newline at end of file +$current_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent +$pype_root = (Get-Item $current_dir).parent.FullName + +Set-Location -Path $pype_root + +git submodule update --recursive --remote + +Set-Location -Path $current_dir \ No newline at end of file