KosalaHerath/macos-installer-builder

Script does not work when in file path with spaces

Closed this issue · 1 comments

When running the script from a file path without spaces:
/Users/axemasta/Desktop/macos-installer-builder/macOS-x64/build-macos-x64.sh

The script executes and works as expected.

When running the script from a file path with spaces:
/Users/axemasta/Desktop/Lunatic Using Spaces/macOS-x64/build-macos-x64.sh

The script reports a number of errors and fails to execute. This is caused by the use of variables not being escaped and causing the spaces cause confusion. For example if I tried to make a directory at the following location:

TARGET_DIRECTORY="/Users/axemasta/Desktop/Lunatic Using Spaces/macOS-x64/target"
mkdir $TARGET_DIRECTORY

It would make a folder at path:
/Users/axemasta/Desktop/Lunatic

The usage needs to be escaped like so:
mkdir "$TARGET_DIRECTORY"

I know its a little bit of a nit pick but I've cleaned up the file to escape any paths so that it can be used by crazy people like me who like to put spaces in their repository & folders.

Fantastic tool helped me build an installer really quickly, thanks a-lot for providing this!

Cheers! Closing with #19