diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:35 +0000 |
commit | f09848204fa5283d21ea43e262ee41aa578e1808 (patch) | |
tree | c62385d7adf209fa6a798635954d887f718fb3fb /packaging/windows/functions.ps1 | |
parent | Releasing debian version 1.46.3-2. (diff) | |
download | netdata-f09848204fa5283d21ea43e262ee41aa578e1808.tar.xz netdata-f09848204fa5283d21ea43e262ee41aa578e1808.zip |
Merging upstream version 1.47.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/windows/functions.ps1')
-rw-r--r-- | packaging/windows/functions.ps1 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packaging/windows/functions.ps1 b/packaging/windows/functions.ps1 new file mode 100644 index 000000000..a5f032daa --- /dev/null +++ b/packaging/windows/functions.ps1 @@ -0,0 +1,31 @@ +# Functions used by the PowerShell scripts in this directory. + +#Requires -Version 4.0 + +function Get-MSYS2Prefix { + if (-Not ($msysprefix)) { + if (Test-Path -Path C:\msys64\usr\bin\bash.exe) { + return "C:\msys64" + } elseif ($env:ChocolateyToolsLocation) { + if (Test-Path -Path "$env:ChocolateyToolsLocation\msys64\usr\bin\bash.exe") { + Write-Host "Found MSYS2 installed via Chocolatey" + Write-Host "This will work for building Netdata, but not for packaging it" + return "$env:ChocolateyToolsLocation\msys64" + } + } + } + + return "" +} + +function Get-MSYS2Bash { + $msysprefix = $args[0] + + if (-Not ($msysprefix)) { + $msysprefix = Get-MSYS2Prefix + } + + Write-Host "Using MSYS2 from $msysprefix" + + return "$msysprefix\usr\bin\bash.exe" +} |