diff --git a/README.md b/README.md index a848f73..84013ce 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,13 @@ Command-line utility for quickly executing files containing code in a compiled l Seemlessly execute files as if they were scripts, leaving no trace of binaries behind. +## Installation +To install *car* enter the following command into a terminal: + +``` +sudo curl -sL "$(curl -s https://api.github.com/repos/nicholaschiasson/car/releases/latest | sed -n -e 's/^.*"browser_download_url": "\(.*\)"$/\1/p')" | sh +``` + ## Usage - Add *car* to a local bin directory and make sure the directory is part of your ${PATH} environment variable. diff --git a/build/car_setup.sh b/build/car_setup.sh index 432f73a..934053f 100755 --- a/build/car_setup.sh +++ b/build/car_setup.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh -sudo curl https://raw.githubusercontent.com/nicholaschiasson/car/master/src/car.sh -o /usr/local/bin/car -sudo chmod ugo+x /usr/local/bin/car +echo "Downloading car and intalling into /usr/local/bin/" +sudo curl -sSf https://raw.githubusercontent.com/nicholaschiasson/car/master/src/car.sh -o /usr/local/bin/car || (>&2 echo "Download failed." && exit 1) +sudo chmod ugo+x /usr/local/bin/car || (>&2 echo "Installation failed." && exit 1) +echo "Installation complete!" diff --git a/src/car.sh b/src/car.sh index 4b2d432..1ad10ae 100755 --- a/src/car.sh +++ b/src/car.sh @@ -96,7 +96,7 @@ function Error() ERROR_MESSAGE="$1" fi - [ -n "$ERROR_MESSAGE" ] && (>&2 echo "car: "$(ColorEcho "${color_light_red}" error:)" ${ERROR_MESSAGE}") + [ -n "$ERROR_MESSAGE" ] && (>&2 echo "car: "$(ColorEcho "${color_light_red}" error:)" ${ERROR_MESSAGE}") exit $EXIT_CODE }