Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed MacOS install and added test #93

Merged
merged 1 commit into from May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -96,6 +96,10 @@ jobs:
- name: Run cargo test
run: cargo test --locked

- name: Test install from local file (bash)
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macOS')
run: ./install.sh ./target/release/dvm

- name: Pre-release (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down
21 changes: 16 additions & 5 deletions install.sh
Expand Up @@ -13,10 +13,11 @@ fi
if [ "$OS" = "Windows_NT" ]; then
target="x86_64-pc-windows-msvc"
else
case $(uname -s) in
case $(uname -sm) in
"Darwin x86_64") target="x86_64-apple-darwin" ;;
"Darwin arm64") target="aarch64-apple-darwin" ;;
*) target="x86_64-unknown-linux-gnu" ;;
"Linux x86_64") target="x86_64-unknown-linux-gnu" ;;
*) echo "Unsupported OS + CPU combination: $(uname -sm)"; exit 1 ;;
esac
fi

Expand All @@ -31,11 +32,21 @@ if [ ! -d "$dvm_bin_dir" ]; then
mkdir -p "$dvm_bin_dir"
fi

curl --fail --location --progress-bar --output "$exe.zip" "$dvm_uri"
if [ "$1" = "" ]; then
cd "$dvm_bin_dir"
curl --fail --location --progress-bar --output "$exe.zip" "$dvm_uri"
unzip -o "$exe.zip"
rm "$exe.zip"
else
echo "Install path override detected: $1"
if [ ! -f "$1" ]; then
echo "File does not exist: $1"
exit 1
fi
cp "$1" "$exe"
fi
cd "$dvm_bin_dir"
unzip -o "$exe.zip"
chmod +x "$exe"
rm "$exe.zip"

case $SHELL in
/bin/zsh) shell_profile=".zshrc" ;;
Expand Down