Skip to content

Support paths with spaces in Makefile #1353

@malexmave

Description

@malexmave

🐞 Bug report

The Makefile does not support paths with spaces.

Describe the bug

If the repository is cloned to a location where the path leading to the repository contains spaces, Makefile commands can fail.

Try the following:

$ cd /tmp
$ git clone https://github.com/securecodebox/secureCodeBox "secure Code Box"
$ cd "secure Code Box"
$ make create-new-scanner NAME=test
find: /tmp/secure: No such file or directory
find: Code: No such file or directory
find: Box: No such file or directory
rm -rf /tmp/secure Code Box/scanners/test
cp -r /tmp/secure Code Box/.templates/new-scanner/ /tmp/secure Code Box/scanners/test
cp: Box/scanners/test is not a directory

Expected behavior

The Makefile should create a new scanner, instead of choking on the space and dying (or, even worse, copying stuff around randomly based on prefixes and polluting the file system of the user, or deleting their files, or...).

System (please complete the following information):

Should apply equally to Mac OS (tested), Linux (untested), Windows with WSL (tested)

Ideology

Yes, I know, spaces in folder names are considered an antipattern by some people. Still, in many situations (e.g., if you are using Windows with WSL and use your full name as username, and you drop your stuff in the "My Files" area of the system), you are pretty much guaranteed to encounter spaces. Instead of forcing developers to switch their workflows and where they store their code, we should just support this use case, if at all possible. And if we do not want to support this for whatever reason, we should ensure that the Makefile checks if there are spaces in the folder path, and refuse to perform operations that may break because of them, instead of bugging out and doing weird stuff that may or may not end up creating and deleting files in random places.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions