diff --git a/src/cmd-init b/src/cmd-init index f53bdfd949f5b5abb8a5b9591da197169f25c7bc..53402aef1a0fc5bc7cf29952380b26119c72c93d 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -82,15 +82,15 @@ if [ $# = 0 ]; then exit 1 fi +source=$1; shift +subdir=${1:-} + # If the current working dir is not empty then error out # unless force provided -if [ "$FORCE" != "1" ] && [ -n "$(ls ./)" ]; then +if [[ ${source} != /* ]] && [ "$FORCE" != "1" ] && [ -n "$(ls ./)" ]; then fatal "init: current directory is not empty, override with --force" fi -source=$1; shift -subdir=${1:-} - preflight if has_privileges; then