From 4c98930091b28089f669eee9748444219938d93d Mon Sep 17 00:00:00 2001 From: Gordon Thiesfeld Date: Thu, 24 Feb 2011 00:09:23 -0600 Subject: [PATCH] fixed powershell scripts --- lib/pik/scripts/powershell_file.rb | 4 ++-- tools/pik.ps1 | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/pik/scripts/powershell_file.rb b/lib/pik/scripts/powershell_file.rb index 394b7f3..6079d6c 100644 --- a/lib/pik/scripts/powershell_file.rb +++ b/lib/pik/scripts/powershell_file.rb @@ -17,7 +17,7 @@ def call(exe) end def echo(str) - "Write-Host #{str}" + @lines << "Write-Host #{str}" end def set(items) @@ -25,7 +25,7 @@ def set(items) @lines << if v "$ENV:#{k}=\"#{v}\"" else - "Remove-Item ENV:#{k}" + "if ($ENV:#{k}){ Remove-Item ENV:#{k} }" end end diff --git a/tools/pik.ps1 b/tools/pik.ps1 index ebe5c62..d393ced 100644 --- a/tools/pik.ps1 +++ b/tools/pik.ps1 @@ -1,3 +1,9 @@ pik_runner.exe $MyInvocation.MyCommand.Definition $args -if(test-path -path "$ENV:HOME\.pik\pik_run.ps1"){& $ENV:HOME\.pik\pik_run.ps1} - +if($ENV:PIK_HOME) + { + if(test-path "$ENV:PIK_HOME\pik_run.ps1"){& $ENV:HOME\.pik\pik_run.ps1 } + } +else + { + if(test-path "$ENV:HOME\.pik\pik_run.ps1"){& $ENV:HOME\.pik\pik_run.ps1 } + }