Skip to content

Commit

Permalink
support installing mpm from source (#56)
Browse files Browse the repository at this point in the history
support installing mpm from source
  • Loading branch information
JerryKwan committed Jul 5, 2022
1 parent 67027f9 commit 3f46c6c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions scripts/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,26 @@ function install_mpm {
if [[ $(uname -s) == "Darwin" ]]; then
mpm_file="mpm-macos-latest";
else
if [[ $(lsb_release -r | cut -f 2) == '18.04' ]]; then
mpm_file="mpm-ubuntu-18.04";
if [ "$(. /etc/os-release; echo $NAME)" = "Ubuntu" ]; then
if [[ $(lsb_release -r | cut -f 2) == '18.04' ]]; then
mpm_file="mpm-ubuntu-18.04";
else
mpm_file="mpm-ubuntu-latest";
fi
else
mpm_file="mpm-ubuntu-latest";
mpm_file="";
fi
fi
curl -sL -o "${INSTALL_DIR}${mpm_file}.zip" "https://github.com/starcoinorg/starcoin/releases/download/${MPM_VERSION}/${mpm_file}.zip"
unzip -q "${INSTALL_DIR}${mpm_file}.zip" -d "${INSTALL_DIR}"
mv "${INSTALL_DIR}${mpm_file}/mpm" "${INSTALL_DIR}mpm"
chmod +x "${INSTALL_DIR}mpm"
rmdir "${INSTALL_DIR}${mpm_file}"
if [[ $mpm_file != "" ]]; then
curl -sL -o "${INSTALL_DIR}${mpm_file}.zip" "https://github.com/starcoinorg/starcoin/releases/download/${MPM_VERSION}/${mpm_file}.zip"
unzip -q "${INSTALL_DIR}${mpm_file}.zip" -d "${INSTALL_DIR}"
mv "${INSTALL_DIR}${mpm_file}/mpm" "${INSTALL_DIR}mpm"
chmod +x "${INSTALL_DIR}mpm"
rmdir "${INSTALL_DIR}${mpm_file}"
else
echo "Install mpm from source"
cargo install --git https://github.com/starcoinorg/starcoin move-package-manager --tag $MPM_VERSION --bin mpm --root $HOME
fi
fi
}

Expand Down

0 comments on commit 3f46c6c

Please sign in to comment.