From 27c62c89c41eb87bc0490ac1a499e237c6fbefe0 Mon Sep 17 00:00:00 2001 From: moqsien Date: Mon, 17 Jun 2024 10:21:57 +0800 Subject: [PATCH] scripts --- scripts/install.preview.ps1 | 16 +++++++++++----- scripts/install.preview.sh | 25 +++++++++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/scripts/install.preview.ps1 b/scripts/install.preview.ps1 index c4957f0..f1470ed 100644 --- a/scripts/install.preview.ps1 +++ b/scripts/install.preview.ps1 @@ -1,4 +1,7 @@ <# + @@ ==================================================== + @@ Installs/Updates version-manager(vmr) for Windows + @@ ==================================================== @@ Copyright (c) 2024 moqsien@hotmail.com @@ @@ Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -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..." @@ -51,4 +57,4 @@ if ( $TRUE_FALSE -eq "True" ) remove-Item -Recurse -Force .\vmr.exe } remove-Item -Recurse -Force $filename -} \ No newline at end of file +} diff --git a/scripts/install.preview.sh b/scripts/install.preview.sh index d9e60b2..5789022 100644 --- a/scripts/install.preview.sh +++ b/scripts/install.preview.sh @@ -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 moqsien@hotmail.com # @@ -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" @@ -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"