add a way to install prereleases

pull/58/head v2.4.8-rc1
Simon Let 6 years ago
parent 6afec834d1
commit f73e4f9c28
  1. 37
      scripts/install.sh
  2. 15
      scripts/rawinstall.sh

@ -63,19 +63,30 @@ else
fi fi
fi fi
# if setsid --version >/dev/null 2>&1; then
# echo " * Setsid installed: OK" if [ "$(uname)" = Darwin ]; then
# else if gnohup --version >/dev/null 2>&1; then
# echo " * Setsid installed: NOT INSTALLED!" echo " * Nohup installed: OK"
# # > Install using ... else
# fi echo " * Nohup installed: NOT INSTALLED!"
echo " > You don't have nohup"
# if gnohup --version >/dev/null 2>&1; then echo " > Please install GNU coreutils"
# echo " * Setsid installed: OK" echo
# else echo " $ brew install coreutils"
# echo " * Setsid installed: NOT INSTALLED!" echo
# # > Install using ... exit 1
# fi fi
else
if setsid --version >/dev/null 2>&1; then
echo " * Setsid installed: OK"
else
echo " * Setsid installed: NOT INSTALLED!"
echo " > You don't have setsid"
echo " > Please install unix-util"
echo
exit 1
fi
fi
# echo # echo
# echo "Continue with installation? (Any key to CONTINUE / Ctrl+C to ABORT)" # echo "Continue with installation? (Any key to CONTINUE / Ctrl+C to ABORT)"

@ -6,16 +6,19 @@ echo
echo "Please report any issues you encounter to: https://github.com/curusarn/resh/issues" echo "Please report any issues you encounter to: https://github.com/curusarn/resh/issues"
echo echo
if [ "$1" = "--test" ] || [ "$1" = "-t" ]; then
echo "Looking for the latest release or PRERELEASE (because you used --test flag) ..."
# debug
# latest release OR pre-release
json=$(curl --silent "https://api.github.com/repos/curusarn/resh/releases")
tag=$(echo "$json" | grep '"tag_name":' | cut -d':' -f2 | tr -d ',' | cut -d'"' -f2 | sort --version-sort --reverse | head -n 1)
else
echo "Looking for the latest release ..." echo "Looking for the latest release ..."
json=$(curl --silent "https://api.github.com/repos/curusarn/resh/releases/latest")
# latest release # latest release
json=$(curl --silent "https://api.github.com/repos/curusarn/resh/releases/latest")
# not very robust but we don't want any dependencies to parse to JSON # not very robust but we don't want any dependencies to parse to JSON
tag=$(echo "$json" | grep '"tag_name":' | cut -d':' -f2 | tr -d ',' | cut -d'"' -f2) tag=$(echo "$json" | grep '"tag_name":' | cut -d':' -f2 | tr -d ',' | cut -d'"' -f2)
fi
# latest release OR pre-release
# json=$(curl --silent "https://api.github.com/repos/curusarn/resh/releases")
# tag=$(echo "$json" | grep '"tag_name":' | cut -d':' -f2 | tr -d ',' | cut -d'"' -f2 | sort --version-sort --reverse | head -n 1)
if [ ${#tag} -lt 2 ]; then if [ ${#tag} -lt 2 ]; then
echo "ERROR: Couldn't determine the latest release! (extracted git tag is too short \"${tag}\")" echo "ERROR: Couldn't determine the latest release! (extracted git tag is too short \"${tag}\")"

Loading…
Cancel
Save