Make sure cleanup is actually working (#21)
This commit is contained in:
1 parent
d626265b55
commit
d351788697
1 file changed
+3
-7
@@ -16,6 +16,7 @@ FRAMEWORKDIR="/Library/ManagedFrameworks/Python"
|
|||||||
PYTHON_BIN="$FRAMEWORKDIR/Python3.framework/Versions/Current/bin/python3"
|
PYTHON_BIN="$FRAMEWORKDIR/Python3.framework/Versions/Current/bin/python3"
|
||||||
RP_BINDIR="/tmp/relocatable-python"
|
RP_BINDIR="/tmp/relocatable-python"
|
||||||
MP_BINDIR="/tmp/munki-pkg"
|
MP_BINDIR="/tmp/munki-pkg"
|
||||||
|
CONSOLEUSER=$(/usr/bin/stat -f "%Su" /dev/console)
|
||||||
PIPCACHEDIR="/Users/${CONSOLEUSER}/Library/Caches/pip"
|
PIPCACHEDIR="/Users/${CONSOLEUSER}/Library/Caches/pip"
|
||||||
|
|
||||||
# Sanity Checks
|
# Sanity Checks
|
||||||
@@ -51,11 +52,6 @@ else
|
|||||||
echo " A python framework with libraries for as many macadmin tools as possible"
|
echo " A python framework with libraries for as many macadmin tools as possible"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
## Root Check
|
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
|
||||||
echo "This tool requires elevated access to run"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$3" ]; then
|
if [ -n "$3" ]; then
|
||||||
PYTHON_VERSION=$3
|
PYTHON_VERSION=$3
|
||||||
@@ -84,9 +80,9 @@ if [ ! -d "${FRAMEWORKDIR}" ]; then
|
|||||||
/usr/bin/sudo /bin/mkdir -m 777 -p "${FRAMEWORKDIR}"
|
/usr/bin/sudo /bin/mkdir -m 777 -p "${FRAMEWORKDIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove existing library Python.framework if present
|
# remove existing Python.framework if present
|
||||||
if [ -d "${FRAMEWORKDIR}/Python.framework" ]; then
|
if [ -d "${FRAMEWORKDIR}/Python.framework" ]; then
|
||||||
/bin/rm -rf "${FRAMEWORKDIR}/Python.framework"
|
/usr/bin/sudo /bin/rm -rf "${FRAMEWORKDIR}/Python.framework"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove existing library Python.framework if present
|
# remove existing library Python.framework if present
|
||||||
|
|||||||
Reference in new issue
Block a user