Add template to mktemp commands, for compatibility with earlier versions of MacOS.
Merged
Add template to mktemp commands, for compatibility with earlier versions of MacOS.
yaxu/ghcup:patch-2
into
master
2 unresolved threads
2 unresolved threads
Compare changes
+ 19
− 10
@@ -1020,6 +1020,20 @@ download_to_stdout() {
@@ -1414,8 +1428,7 @@ install_ghc() {
@@ -1554,7 +1567,8 @@ upgrade() {
@@ -1679,8 +1693,7 @@ install_cabal() {
@@ -1741,8 +1754,7 @@ compile_ghc() {
@@ -2015,9 +2027,6 @@ print_system_reqs() {
Now that I think about it, check not just if the variable is set, but also if the directory exists!
https://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html
Also, we are basically creating a global variable and don't know when a caller reads it. So the caller has to unset it as well. This is problematic API.
I suggest to remove the error checks and just have a simple if else for the mktemp call, without setting any variable and without erroring out. Then the caller Has full control.