From ecf5f038dd3cd849eb9bcd03f002da6fbd8fd6a2 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 6 Nov 2017 18:11:05 -0700 Subject: [PATCH] test without [ --- install.sh | 2 +- installer/my-user-my-group.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ee4eee9..21ad5fe 100644 --- a/install.sh +++ b/install.sh @@ -96,7 +96,7 @@ popd # source ./installer/my-root.sh echo "Pre-installation to $my_app_dir complete, now installing to $my_root/ ..." -if [ type -p tree ]; then +if type -p tree >/dev/null 2>/dev/null; then #tree -I "node_modules|include|share" $my_app_dir tree -L 6 -I "include|share|npm" $my_app_dir else diff --git a/installer/my-user-my-group.sh b/installer/my-user-my-group.sh index 80628ca..82282a3 100644 --- a/installer/my-user-my-group.sh +++ b/installer/my-user-my-group.sh @@ -1,6 +1,6 @@ -if [ type -p adduser ]; then - if [ -z "$(cat /etc/passwd | grep $my_app_name)" ]; then - $sudo_cmd adduser --home /opt/$my_app_name --gecos '' --disabled-password $my_app_name +if type -p adduser >/dev/null 2>/dev/null; then + if [ -z "$(cat $my_root/etc/passwd | grep $my_app_name)" ]; then + $sudo_cmd adduser --home $my_root/opt/$my_app_name --gecos '' --disabled-password $my_app_name fi my_user=$my_app_name my_group=$my_app_name