mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
install.sh: Add message on error exit and simplify installation command (#9654)
* Add error trap for install.sh * Disable SC2164 * Add `set -e` back * Remove source prompt * Update README.md
This commit is contained in:
@@ -60,7 +60,7 @@ Open a VT-2 terminal session with <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>-></kbd> a
|
|||||||
Then run the installation script below:
|
Then run the installation script below:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
exec bash --init-file <(curl -Ls git.io/vddgY)
|
bash <(curl -L git.io/vddgY) && . ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Exit on fail.
|
# Exit on fail.
|
||||||
set -e
|
set -eE
|
||||||
|
|
||||||
RESET='\e[0m'
|
RESET='\e[0m'
|
||||||
|
|
||||||
@@ -12,6 +12,9 @@ echo_success() { echo -e "\e[1;32m${*}${RESET}" >&1; } # Use Green for success m
|
|||||||
echo_intra() { echo -e "\e[1;34m${*}${RESET}" >&1; } # Use Blue for intrafunction messages.
|
echo_intra() { echo -e "\e[1;34m${*}${RESET}" >&1; } # Use Blue for intrafunction messages.
|
||||||
echo_out() { echo -e "\e[0;37m${*}${RESET}" >&1; } # Use Gray for program output.
|
echo_out() { echo -e "\e[0;37m${*}${RESET}" >&1; } # Use Gray for program output.
|
||||||
|
|
||||||
|
# Print a message before exit on error
|
||||||
|
trap "echo_error 'An error occured during the installation :/'" ERR
|
||||||
|
|
||||||
# Check if the script is being run as root.
|
# Check if the script is being run as root.
|
||||||
if [ "${EUID}" == "0" ]; then
|
if [ "${EUID}" == "0" ]; then
|
||||||
echo_error "Chromebrew should not be installed or run as root."
|
echo_error "Chromebrew should not be installed or run as root."
|
||||||
@@ -368,8 +371,6 @@ echo " ___ _ _
|
|||||||
\___/| |_/ |_/\__/ | | |_/|__/\__/ |_/|__/ \_/ \_/
|
\___/| |_/ |_/\__/ | | |_/|__/\__/ |_/|__/ \_/ \_/
|
||||||
"
|
"
|
||||||
|
|
||||||
echo_info "Please run 'source ~/.bashrc' to set up the profile environment."
|
|
||||||
|
|
||||||
echo_intra "
|
echo_intra "
|
||||||
Edit ${CREW_PREFIX}/etc/env.d/03-pager to change the default PAGER.
|
Edit ${CREW_PREFIX}/etc/env.d/03-pager to change the default PAGER.
|
||||||
most is used by default
|
most is used by default
|
||||||
|
|||||||
Reference in New Issue
Block a user