For me, the command causing the error is as follows:
curl --dump-header /tmp/curl-header59263-0 -fL -o /home/heitor/.ghcup/cache/ghcup-0.0.8.yaml.tmp https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
I then create two directories with write permissions: "x" and ".x". Running the command so that these directories are the destination directories, I get the following result:
heitor@heitor-kubuntu:~$ curl -o x/ghcup-0.0.8.yaml https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 463k 100 463k 0 0 7838k 0 --:--:-- --:--:-- --:--:-- 7861k
heitor@heitor-kubuntu:~$ curl -o .x/ghcup-0.0.8.yaml https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to open the file .x/ghcup-0.0.8.yaml: Permission denied
3 463k 3 16375 0 0 711k 0 --:--:-- --:--:-- --:--:-- 726k
curl: (23) Failure writing output to destination
I then get the impression that the error is due to writing the destination file in a directory starting with a dot ".", in this case, the ".ghcup" directory used by the installation script.
Is my analysis correct? If so, how can I suggest a fix for the installation script? If not, what am I doing wrong?