install2
This commit is contained in:
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
## library of useful functions, usually prefixed with '_'
|
## library of useful functions, usually prefixed with '_'
|
||||||
|
|
||||||
|
function sudo_root {
|
||||||
|
[[ "$UID" -ne 0 ]] && sudo -vp 'SUDO privilege required: '
|
||||||
|
}
|
||||||
|
|
||||||
## ASSERT Functions
|
## ASSERT Functions
|
||||||
|
|
||||||
function assert_root {
|
function assert_root {
|
||||||
@@ -16,7 +20,7 @@ function assert_system_mode {
|
|||||||
>&2 echo "ERROR: development mode: $(realpath "$MIAOU_BASH_DIR")" &&
|
>&2 echo "ERROR: development mode: $(realpath "$MIAOU_BASH_DIR")" &&
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
assert_container && [[ ! -w $MIAOU_BASH_DIR ]] &&
|
assert_container && ! sudo test -w "$MIAOU_BASH_DIR" &&
|
||||||
>&2 echo "ERROR: hosted mode" &&
|
>&2 echo "ERROR: hosted mode" &&
|
||||||
return 4
|
return 4
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ function self_upgrade {
|
|||||||
# MAIN
|
# MAIN
|
||||||
|
|
||||||
source "$MIAOU_BASH_DIR"/lib/functions.bash
|
source "$MIAOU_BASH_DIR"/lib/functions.bash
|
||||||
|
sudo_root
|
||||||
assert_system_mode
|
assert_system_mode
|
||||||
|
|
||||||
current=$(miaou-bash --version)
|
current=$(miaou-bash --version)
|
||||||
|
|||||||
Reference in New Issue
Block a user