mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
chore: use rmdir
to delete empty npm etc/
directory (#933)
NPM might create an empty `etc/` directory when calling it with the `--prefix` option and we have a check to see if this directory indeed exists and its empty in order to proceed and delete it. We currently use `rm -rf` for it, even though `rmdir` is sufficient. See: https://github.com/resin-io/etcher/pull/923#discussion_r90570968 Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
ce206fc0b7
commit
0c1f9e93ba
@ -114,7 +114,7 @@ if [ -n "$ARGV_PREFIX" ]; then
|
||||
|
||||
# Using `--prefix` might cause npm to create an empty `etc` directory
|
||||
if [ ! "$(ls -A "$ARGV_PREFIX/etc")" ]; then
|
||||
rm -rf "$ARGV_PREFIX/etc"
|
||||
rmdir "$ARGV_PREFIX/etc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user