BerriAI / clerkie-cli

Clerkie-cli is a terminal tool that uses an LLM to help debug and troubleshoot coding errors in any programming language. It offers explanations, suggested fixes, guidance, alternative approaches, and code examples. It is useful for developers of all skill levels.
93 stars 7 forks source link

Fix home directories with spaces in the path #3

Open nicolaschan opened 1 year ago

nicolaschan commented 1 year ago

When the home directory path has a space in the path we get an error like this:

https://github.com/ishaan-jaff/clerkie-cli/archive/refs/tags/v0.0.2-beta.zip
main: line 14: cd: too many arguments
downloading latest release in /home/nicolas/foo bar//.clerkie-cli
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to open the file /home/nicolas/foo: Is a directory
100   512    0   512    0     0    578      0 --:--:-- --:--:-- --:--:--  2081
curl: (23) Failure writing output to destination
curl: (6) Could not resolve host: bar
main: line 42: err: command not found
chmod: cannot access 'bar//.clerkie-cli/release.zip': No such file or directory
unzip:  cannot find or open /home/nicolas/foo, /home/nicolas/foo.zip or /home/nicolas/foo.ZIP.
rm: cannot remove '/home/nicolas/foo': Is a directory
rm: cannot remove 'bar//.clerkie-cli/release.zip': No such file or directory
installed clerkie and unzipped
renaming bar/
Clerkie Installed. Open a new Terminal Window to start using

This PR fixes this error by properly quoting all variables. I also fix other shellcheck linting issues and add a GitHub action to automatically check the install script for linting issues.