Add template to mktemp commands, for compatibility with earlier versions of MacOS.

Ref: https://forum.toplap.org/t/trouble-setting-up-tidal-stack-install/902/20
This commit is contained in:
Alex McLean 2019-10-31 06:42:05 -04:00
parent 42e8989d0b
commit 021a983e91

8
ghcup
View File

@ -1414,7 +1414,7 @@ install_ghc() {
first_install=false first_install=false
fi fi
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d -t ghcup.XXXXXXXX)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" [ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then
@ -1554,7 +1554,7 @@ upgrade() {
status_message "Updating ${SCRIPT}" status_message "Updating ${SCRIPT}"
( (
edo cd "$(mktemp -d)" edo cd "$(mktemp -d -t ghcup.XXXXXXXX)"
download "${SCRIPT_UPDATE_URL}" download "${SCRIPT_UPDATE_URL}"
edo chmod +x ghcup edo chmod +x ghcup
edo mv -f ghcup "${target_location}"/ghcup edo mv -f ghcup "${target_location}"/ghcup
@ -1679,7 +1679,7 @@ install_cabal() {
edo mkdir -p "${inst_location}" edo mkdir -p "${inst_location}"
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d -t ghcup.XXXXXXXX)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" [ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then
@ -1741,7 +1741,7 @@ compile_ghc() {
fi fi
status_message "Compiling GHC for version ${myghcver} from source" status_message "Compiling GHC for version ${myghcver} from source"
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d -t ghcup.XXXXXXXX)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" [ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then