Commit b5096d70 by Riccardo Vicedomini

attempt to fix macOS problem with mktemp

parent 8113881f
......@@ -145,10 +145,13 @@ fi
# Create temp working directory
if [ -z "${PV_TMPDIR}" ]; then
PV_TMPDIR=$(mktemp -p "${TMPDIR:-.}" -d pvtmp-XXXXX) || {
print_error "cannot create temporary directory"
exit 1
}
if [ check_system = "Linux" ]; then
PV_TMPDIR=$(mktemp -p "${PWD}" -d pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
else
PV_TMPDIR=$(mktemp -d "${PWD}"/pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
fi
else
mkdir -p "${PV_TMPDIR}" || { print_error "cannot create temporary directory"; exit 1; }
fi
PV_TMPDIR=$(abspath "${PV_TMPDIR}")
if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then
......
......@@ -181,10 +181,13 @@ fi
# Create temp working directory
if [ -z "${PV_TMPDIR}" ]; then
PV_TMPDIR=$(mktemp -p "${TMPDIR:-.}" -d pvtmp-XXXXX) || {
print_error "cannot create temporary directory"
exit 1
}
if [ check_system = "Linux" ]; then
PV_TMPDIR=$(mktemp -p "${PWD}" -d pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
else
PV_TMPDIR=$(mktemp -d "${PWD}"/pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
fi
else
mkdir -p "${PV_TMPDIR}" || { print_error "cannot create temporary directory"; exit 1; }
fi
PV_TMPDIR=$(abspath "${PV_TMPDIR}")
if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment