aboutsummaryrefslogtreecommitdiffstats
path: root/dist/mcode/windows/shared.psm1
diff options
context:
space:
mode:
authortgingold <tgingold@users.noreply.github.com>2016-10-15 07:28:27 +0200
committerGitHub <noreply@github.com>2016-10-15 07:28:27 +0200
commit7fa815ac040716daf38aa59563fbf787dba4b7d7 (patch)
tree99288ef898719b5193890439f99d4cea5d6e6cc9 /dist/mcode/windows/shared.psm1
parente7529aba20ec36d9710f9bff6eb18ea3d77b322c (diff)
parentd1fb7f9772ec1a4fafb39c75a52ef064b6467398 (diff)
downloadghdl-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.psm119
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
}