diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-11-11 23:00:32 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-11-11 23:00:32 (EST) |
commit | db4273ef349f556a1b65926200668ab5e467110d (patch) | |
tree | 4d1557a4a34a8058aebb3748ba43ebcdf3c94926 /lib/cmd | |
parent | 7e06d71041552a4a8b8d874fb81081a810930afd (diff) |
cmd/install: Error only if root dir is not empty
Diffstat (limited to 'lib/cmd')
-rw-r--r-- | lib/cmd/install.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh index 529382d..fbb5d81 100644 --- a/lib/cmd/install.sh +++ b/lib/cmd/install.sh @@ -21,6 +21,7 @@ use getopt use feed use profile +use dir use fd use pkg @@ -97,7 +98,7 @@ cmd_install_main() fi info "$(get_msg 'cmd_install_setting_up_chroot')" - if [ -d "${chroot}" ]; then + if [ -d "${chroot}" ] && ! dir_is_empty "${chroot}"; then error 2 "$(get_msg 'cmd_install_chroot_dir_exists')" "${chroot}" fi if ! mkdir -p "${chroot}/.prokit" "${chroot}/prokit"; then |