From 2526e1d34e2f34d54a7c250efea5061b4a3f3842 Mon Sep 17 00:00:00 2001 From: Zach Bruggeman Date: Wed, 4 Mar 2015 16:13:39 -0800 Subject: [PATCH] Remove node_modules if folder is empty --- tools/osx-pkg/scripts/uninstall.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/osx-pkg/scripts/uninstall.sh b/tools/osx-pkg/scripts/uninstall.sh index edfe5ad0df5df8..a0fb9f9aa1b7bd 100644 --- a/tools/osx-pkg/scripts/uninstall.sh +++ b/tools/osx-pkg/scripts/uninstall.sh @@ -11,5 +11,9 @@ if [ -f /tmp/iojs-run-uninstall ]; then rm -f $DIR_PREFIX/share/man/man1/iojs.1 rm -f $DIR_PREFIX/share/systemtap/tapset/node.stp + if [ ! "$(ls -A $DIR_PREFIX/lib/node_modules)" ]; then + rm -rf $DIR_PREFIX/lib/node_modules + fi + rm -f /tmp/iojs-run-uninstall fi