mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 04:46:19 +10:00
Better error messages
This commit is contained in:
@@ -20,7 +20,7 @@ fi
|
||||
|
||||
$GVM_ROOT/scripts/gvm-check
|
||||
if [[ "$?" != "0" ]]; then
|
||||
display_error "Missing requirements. Please see messages above"
|
||||
display_error "Missing requirements."
|
||||
fi
|
||||
|
||||
if [[ $command == "version" ]]; then
|
||||
|
||||
@@ -50,7 +50,11 @@ SRC_REPO=https://github.com/moovweb/gvm.git
|
||||
[ "$GVM_DEST" == "" ] && display_error "No destination specified!"
|
||||
[ -d $GVM_DEST/$GVM_NAME ] && display_error "Already installed!"
|
||||
[ -d $GVM_DEST ] || mkdir -p $GVM_DEST > /dev/null 2>&1 || display_error "Failed to create $GVM_DEST"
|
||||
[ -z `which git` ] && display_error '* Could not find git (try `sudo apt-get install git`)'
|
||||
[ -z `which git` ] && display_error "Could not find git
|
||||
|
||||
linux: apt-get install git
|
||||
mac: brew install git
|
||||
"
|
||||
|
||||
cd $GVM_DEST && git clone $SRC_REPO $GVM_NAME > /dev/null 2>&1 ||
|
||||
display_error "Failed to clone from $SRC_REPO into $GVM_DEST/$GVM_NAME"
|
||||
|
||||
+31
-9
@@ -1,15 +1,37 @@
|
||||
#!/bin/bash
|
||||
. $GVM_ROOT/scripts/functions
|
||||
|
||||
# Check for hg
|
||||
[ -z `which hg` ] &&
|
||||
display_error '* Could not find mercurial (try `sudo apt-get install mercurial`)'
|
||||
[ -z `which ar` ] &&
|
||||
display_error '* Could not find binutils (try `sudo apt-get install binutils (or binutils-multiarch)`)'
|
||||
[ -z `which bison` ] &&
|
||||
display_error '* Could not find bison (try `sudo apt-get install bison`)'
|
||||
[ -z `which gcc` ] &&
|
||||
display_error '* Could not find gcc (try `sudo apt-get install gcc`)'
|
||||
[ -z `which make` ] &&
|
||||
display_error '* Could not find make (try `sudo apt-get install make`)'
|
||||
display_warning "Could not find mercurial
|
||||
|
||||
linux: apt-get install mercurial
|
||||
mac: brew install mercurial
|
||||
" && exit 1
|
||||
# Check for ar
|
||||
[ -z `which ar` ] &&
|
||||
display_warning "Could not find binutils
|
||||
|
||||
linux: apt-get install binutils
|
||||
" && exit 1
|
||||
# Check for bison
|
||||
[ -z `which bison` ] &&
|
||||
display_warning "Could not find bison
|
||||
|
||||
linux: apt-get install bison
|
||||
" && exit 1
|
||||
# Check for gcc
|
||||
[ -z `which gcc` ] &&
|
||||
display_warning "Could not find gcc
|
||||
|
||||
linux: apt-get install gcc
|
||||
" && exit 1
|
||||
# Check for make
|
||||
[ -z `which make` ] &&
|
||||
display_warning "Could not find make
|
||||
|
||||
linux: apt-get install make
|
||||
" && exit 1
|
||||
|
||||
# All good!
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user