diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d2c3f67a669..d6b006616ef 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,9 +1,9 @@ name: PR on: pull_request: -# env: -# MOON_DEBUG: 'true' -# PROTO_DEBUG: 'true' +env: + MOON_DEBUG: 'true' + PROTO_DEBUG: 'true' jobs: version: name: Version check @@ -45,6 +45,8 @@ jobs: if: ${{ runner.os != 'Windows' }} - run: bash ./website/static/install/proto.sh 0.19.0 if: ${{ runner.os != 'Windows' }} + - run: bash ./website/static/install/proto.sh 0.26.0-rc.1 + if: ${{ runner.os != 'Windows' }} # Windows - run: pwsh.exe ./website/static/install/moon.ps1 if: ${{ runner.os == 'Windows' }} @@ -54,3 +56,5 @@ jobs: if: ${{ runner.os == 'Windows' }} - run: pwsh.exe ./website/static/install/proto.ps1 0.19.0 if: ${{ runner.os == 'Windows' }} + - run: pwsh.exe ./website/static/install/proto.ps1 0.26.0-rc.1 + if: ${{ runner.os == 'Windows' }} diff --git a/website/static/install/proto.ps1 b/website/static/install/proto.ps1 index b5a71c00285..714407d31fc 100755 --- a/website/static/install/proto.ps1 +++ b/website/static/install/proto.ps1 @@ -29,6 +29,7 @@ $InstallDir = if ($env:PROTO_INSTALL_DIR) { } $BinPath = "${InstallDir}\proto.exe" +$ShimPath = "${InstallDir}\proto-shim.exe" # Download and unpack in temp dir @@ -36,7 +37,6 @@ if (!(Test-Path $TempDir)) { New-Item $TempDir -ItemType Directory | Out-Null } -# curl.exe -Lo $DownloadFile $DownloadUrl $wc = New-Object Net.Webclient $wc.downloadFile($DownloadUrl, $DownloadFile) @@ -53,6 +53,11 @@ if (!(Test-Path $InstallDir)) { } Copy-Item "${TempDir}\proto.exe" -Destination $BinPath -Force + +if (Test-Path "${TempDir}\proto-shim.exe") { + Copy-Item "${TempDir}\proto-shim.exe" -Destination $ShimPath -Force +} + Remove-Item $TempDir -Recurse -Force Remove-Item $DownloadFile -Force @@ -71,4 +76,5 @@ if ($env:PROTO_DEBUG -eq "true") { Write-Output "target=${Target}" Write-Output "download_url=${DownloadUrl}" Write-Output "bin_path=${BinPath}" + Write-Output "shim_path=${ShimPath}" } diff --git a/website/static/install/proto.sh b/website/static/install/proto.sh index 18e472de929..bad6a524ebe 100755 --- a/website/static/install/proto.sh +++ b/website/static/install/proto.sh @@ -7,6 +7,7 @@ set -eo pipefail bin="proto" +shim_bin="proto-shim" arch=$(uname -sm) version="${1:-latest}" ext=".tar.xz" @@ -14,6 +15,7 @@ ext=".tar.xz" if [[ "$OS" == "Windows_NT" ]]; then target="proto_cli-x86_64-pc-windows-msvc" bin="proto.exe" + shim_bin="proto-shim.exe" ext=".zip" else case "$arch" in @@ -54,17 +56,18 @@ fi temp_dir="$HOME/.proto/temp/proto/$target" download_file="$temp_dir$ext" -if [ -z "$PROTO_INSTALL_DIR" ]; then +if [[ -z "$PROTO_INSTALL_DIR" ]]; then install_dir="$HOME/.proto/bin" else install_dir="$PROTO_INSTALL_DIR" fi bin_path="$install_dir/$bin" +shim_path="$install_dir/$shim_bin" # Download and unpack in temp dir -if [ ! -d "$temp_dir" ]; then +if [[ ! -d "$temp_dir" ]]; then mkdir -p "$temp_dir" fi @@ -81,12 +84,18 @@ fi # Move to bin dir and clean up -if [ ! -d "$install_dir" ]; then +if [[ ! -d "$install_dir" ]]; then mkdir -p "$install_dir" fi mv "$temp_dir/$bin" "$bin_path" chmod +x "$bin_path" + +if [[ -f "$temp_dir/$shim_bin" ]]; then + mv "$temp_dir/$shim_bin" "$shim_path" + chmod +x "$shim_path" +fi + rm -rf "$download_file" "$temp_dir" # Run setup script to update shells @@ -94,7 +103,7 @@ rm -rf "$download_file" "$temp_dir" export PROTO_LOG=error profile_path=$($bin_path setup --profile) -if [ -z "$profile_path" ]; then +if [[ -z "$profile_path" ]]; then echo "Successfully installed proto to $bin_path" else echo "Successfully installed proto to $bin_path and updated $profile_path" @@ -110,6 +119,7 @@ if [[ "$PROTO_DEBUG" == "true" ]]; then echo "target=$target" echo "download_url=$download_url" echo "bin_path=$bin_path" + echo "shim_path=$shim_path" echo "is_wsl=$is_wsl" echo "deps=$deps" fi