diff options
author | tgingold <tgingold@users.noreply.github.com> | 2016-10-15 07:28:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-15 07:28:27 +0200 |
commit | 7fa815ac040716daf38aa59563fbf787dba4b7d7 (patch) | |
tree | 99288ef898719b5193890439f99d4cea5d6e6cc9 /dist/mcode/windows/shared.psm1 | |
parent | e7529aba20ec36d9710f9bff6eb18ea3d77b322c (diff) | |
parent | d1fb7f9772ec1a4fafb39c75a52ef064b6467398 (diff) | |
download | ghdl-7fa815ac040716daf38aa59563fbf787dba4b7d7.tar.gz ghdl-7fa815ac040716daf38aa59563fbf787dba4b7d7.tar.bz2 ghdl-7fa815ac040716daf38aa59563fbf787dba4b7d7.zip |
Merge pull request #165 from Paebbels/fixed-module-unload
Windows Build Flow: Fixed error of premature module unload.
Diffstat (limited to 'dist/mcode/windows/shared.psm1')
-rw-r--r-- | dist/mcode/windows/shared.psm1 | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/dist/mcode/windows/shared.psm1 b/dist/mcode/windows/shared.psm1 index e39ce67ce..81a11be82 100644 --- a/dist/mcode/windows/shared.psm1 +++ b/dist/mcode/windows/shared.psm1 @@ -32,19 +32,19 @@ [CmdletBinding()] param( - [Parameter(Mandatory=$true)][string]$WorkingDir + [Parameter(Mandatory=$true)][string]$WorkingDir, + [Parameter(Mandatory=$true)][Switch]$Hosted ) -$Module_WorkingDir = $WorkingDir +$Module_WorkingDir = $WorkingDir +$Module_Hosted = $Hosted function Exit-CompileScript -{ <# +{ <# .SYNOPSIS Undocumented - .DESCRIPTION Undocumented - .PARAMETER ExitCode ExitCode of this script run #> @@ -52,13 +52,12 @@ function Exit-CompileScript param( [int]$ExitCode = 0 ) - cd $Module_WorkingDir - # unload modules - Remove-Module shared -Verbose:$false - Remove-Module targets -Verbose:$false - + if (-not $Module_Hosted) + { Remove-Module shared -Verbose:$false + Remove-Module targets -Verbose:$false + } exit $ExitCode } |