Skip to content

Commit

Permalink
Update moon.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 5, 2023
1 parent fb0a3b4 commit 2483c2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
7 changes: 6 additions & 1 deletion website/static/install/moon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ $DownloadUrl = if ($Version -eq "latest") {
"https://github.com/moonrepo/moon/releases/download/v${Version}/${Target}"
}

$InstallDir = "${Home}\.moon\bin"
$InstallDir = if ($env:MOON_INSTALL_DIR -eq "") {
"${Home}\.moon\bin"
} else {
$env:MOON_INSTALL_DIR
}

$BinPath = "${InstallDir}\moon.exe"

if (!(Test-Path $InstallDir)) {
Expand Down
21 changes: 10 additions & 11 deletions website/static/install/moon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@ else
is_wsl=false
fi

if [ $# -eq 0 ]; then
if [ "$version" == "latest" ]; then
download_url="https://github.com/moonrepo/moon/releases/latest/download/${target}"
else
download_url="https://github.com/moonrepo/moon/releases/download/v${version}/${target}"
fi

install_dir="$HOME/.moon/bin"
if [ -z "$MOON_INSTALL_DIR" ]; then
install_dir="$MOON_INSTALL_DIR"
else
install_dir="$HOME/.moon/bin"
fi

bin_path="$install_dir/$bin"

if [ ! -d "$install_dir" ]; then
Expand All @@ -60,15 +65,9 @@ curl --fail --location --progress-bar --output "$bin_path" "$download_url"
chmod +x "$bin_path"

echo "Successfully installed moon to $bin_path"

if ln -sf "$bin_path" "/usr/local/bin/$bin" &> /dev/null; then
echo "Run 'moon --help' to get started!"
else
echo "Manually update PATH in your shell to get started!"
echo
echo " export PATH=\"\$HOME/.moon/bin:\$PATH\""
fi

echo "Manually update PATH in your shell to get started!"
echo
echo " export PATH=\"$install_dir:\$PATH\""
echo
echo "Need help? Join our Discord https://discord.gg/qCh9MEynv2"

Expand Down

0 comments on commit 2483c2e

Please sign in to comment.