Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Jun 17, 2024
1 parent bbe4395 commit 27c62c8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
16 changes: 11 additions & 5 deletions scripts/install.preview.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<#
@@ ====================================================
@@ Installs/Updates version-manager(vmr) for Windows
@@ ====================================================
@@ Copyright (c) 2024 [email protected]
@@
@@ Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -29,12 +32,15 @@ if ( "$sysType" -match "arm" )
$arch="arm64"
}

$version="v0.6.2"
# $version="v0.6.2"

$filename="vmr_windows-" + $arch + ".zip"
$download_url="https://proxy.vmr.us.kg/proxy/https://github.com/gvcgo/version-manager/releases/download/"
# $filename="vmr_windows-" + $arch + ".zip"
# $download_url="https://proxy.vmr.us.kg/proxy/https://github.com/gvcgo/version-manager/releases/download/"

# $url=$download_url + $version + "/" + $filename

$url=$download_url + $version + "/" + $filename
$url="https://packages.vmr.us.kg/windows/" + $arch
$filename="vmr_windows-" + $arch + ".zip"

Write-Host "Downloading files..."

Expand All @@ -51,4 +57,4 @@ if ( $TRUE_FALSE -eq "True" )
remove-Item -Recurse -Force .\vmr.exe
}
remove-Item -Recurse -Force $filename
}
}
25 changes: 19 additions & 6 deletions scripts/install.preview.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# ====================================================
# Installs/Updates version-manager(vm) for MacOS/Linux
# Installs/Updates version-manager(vmr) for MacOS/Linux
# ====================================================
# Copyright (c) 2024 [email protected]
#
Expand Down Expand Up @@ -44,9 +44,22 @@ main() {
local os_type="$(uname -s)"
local os_arch="$(uname -m)"

local version="v0.6.2"

local download_url="https://proxy.vmr.us.kg/proxy/https://github.com/gvcgo/version-manager/releases/download/"
# local version="v0.6.2"
# local download_url="https://proxy.vmr.us.kg/proxy/https://github.com/gvcgo/version-manager/releases/download/"
# local osType="linux"
# if [ "$os_type" = "Darwin" ]; then
# osType="darwin"
# fi

# local osArch="amd64"

# if [ "$os_arch" = "arm64" ] || [ "$os_type" = "aarch64" ]; then
# osArch="arm64"
# fi

# local filename="vmr_$osType-$osArch.zip"
# local url="$download_url$version/$filename"

local osType="linux"
if [ "$os_type" = "Darwin" ]; then
osType="darwin"
Expand All @@ -57,9 +70,9 @@ main() {
if [ "$os_arch" = "arm64" ] || [ "$os_type" = "aarch64" ]; then
osArch="arm64"
fi

local url="https://packages.vmr.us.kg/$osType/$osArch"
local filename="vmr_$osType-$osArch.zip"
local url="$download_url$version/$filename"

echo "$url"
need_cmd "curl"
need_cmd "unzip"
Expand Down

0 comments on commit 27c62c8

Please sign in to comment.