This is an automated email from the ASF dual-hosted git repository.
msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git
The following commit(s) were added to refs/heads/main by this push:
new 5dbb353 better windows detection
5dbb353 is described below
commit 5dbb3531bdbdfd1a09ac7d2cce46aa48e529b70c
Author: Michele Sciabarra <[email protected]>
AuthorDate: Fri Aug 9 10:59:41 2024 +0200
better windows detection
---
install.ps1 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/install.ps1 b/install.ps1
index 321ee66..2f90650 100644
--- a/install.ps1
+++ b/install.ps1
@@ -15,11 +15,13 @@
# specific language governing permissions and limitations
# under the License.
+$InWindows = [System.Environment]::OSVersion.Platform -eq 'Win32NT'
+
$SUFFIX = "_windows_amd64"
$EXT = ".zip"
$CMD = "ops.exe"
-if (-not $IsWindows) {
+if (-not $InWindows) {
$OS = (uname -s)
$ARCH = (uname -m)
$CMD = "ops"
@@ -77,7 +79,7 @@ if (-not (Test-Path "$BinPath/$CMD*")) {
# Check if the bin path is in the user's PATH
if (-not ($env:PATH -contains $BinPath)) {
- if($IsWindows) {
+ if($InWindows) {
$existingPath = [System.Environment]::GetEnvironmentVariable("Path",
[System.EnvironmentVariableTarget]::User)
$newPath = "$BinPath;$existingPath"
[System.Environment]::SetEnvironmentVariable("Path", $newPath,
[System.EnvironmentVariableTarget]::User)