From 59f4fd971359005042f8f61a610143b695d98ec3 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 7 Jul 2017 16:42:27 +0200 Subject: [PATCH] Build - import build.ps1 --- build/build.ps1 | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 build/build.ps1 diff --git a/build/build.ps1 b/build/build.ps1 new file mode 100644 index 0000000000..42bf4c81d5 --- /dev/null +++ b/build/build.ps1 @@ -0,0 +1,41 @@ +param ( + [Parameter(Mandatory=$false)] + [string] + $version +) + +# the script can run either from the solution root, +# or from the ./build directory - anything else fails +if ([System.IO.Path]::GetFileName($pwd) -eq "build") +{ + $mpath = [System.IO.Path]::GetDirectoryName($pwd) + "\build\Modules\" +} +else +{ + $mpath = "$pwd\build\Modules\" +} + +# look for the module and throw if not found +if (-not [System.IO.Directory]::Exists($mpath + "Umbraco.Build")) +{ + Write-Error "Could not locate Umbraco.Build Powershell module." + break +} + +# add the module path (if not already there) +if (-not $env:PSModulePath.Contains($mpath)) +{ + $env:PSModulePath = "$mpath;$env:PSModulePath" +} + +# force-import (or re-import) the module +Import-Module Umbraco.Build -Force -DisableNameChecking + +# set the version if any +if (-not [string]::IsNullOrWhiteSpace($version)) +{ + Set-UmbracoVersion $version +} + +# full umbraco build +Build-Umbraco \ No newline at end of file