robert-strandh / SICL

A fresh implementation of Common Lisp
Other
1.07k stars 78 forks source link

`get-dependencies.sh` not working when PROJECTS_DIRECTORY is not specified #195

Closed timmyjose closed 3 years ago

timmyjose commented 3 years ago

Summary: When the directory where the project dependencies will be downloaded is not specified, the script fails in a slightly misleading manner - the default directory, "~/quicklisp/local-projects" is picked up, but the test for directory existence fails due to the tilde not being expanded (since it's quoted).

Steps to reproduce: Running on a vanilla clone:

~/dev/forks/SICL:master$ ./get-dependencies.sh
Usage: ./get-dependencies.sh [PROJECTS_DIRECTORY].

You did not supply a directory to download dependencies into;
the default diretory "~/quicklisp/local-projects/" does not exist.

Checking that the directory actually exists:

~/dev/forks/SICL:master$ [ -d ~/quicklisp/local-projects ] && echo "quicklisp directory exists"
quicklisp directory exists

FIx: We can simply use the $HOME environment variable, which will definitely get expanded inside quotes. Another related problem is if the explicitly supplied directory contains spaces, then the current test will fail. This can be easily fixed by simply wrapping the environment variable inside quotes.

I have raised a PR with the proposed fixes - https://github.com/robert-strandh/SICL/pull/196 .

timmyjose commented 3 years ago

Fixed in https://github.com/robert-strandh/SICL/pull/196 (merged). Closing the issue.