Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow execution of post-install scripts on paths with space
We found that we where not able to install `detox` if the project is installed on a path with spaces on parent directories. For example, if we clone the project on `~/My Projects/my-project`, running `npm install` will fail to locate the `detox/scripts/build_framework.ios.sh`. ``` /bin/sh: /Users/me/My: No such file or directory child_process.js:615 throw err; ^ Error: Command failed: /Users/me/My Projects/my-project/node_modules/detox/scripts/build_framework.ios.sh at checkExecSyncError (child_process.js:575:11) ``` This is related to [node's child_process](nodejs/node#6803) handling of filepaths on `exec`. Instead of locating the file as `~/My Projects/my-project/node_modules/detox/scripts/build_framework.ios.sh`, it passes the argument as `~/My` and fails to execute. This commit changes the execution process to threat the first argument as a file path, instead of arguments to `exec`, which triggers the split by space to determine the arguments. Co-Authored-By: Fellipe Chagas <fellipe.chagas@nubank.com.br> Co-Authored-By: Rafael Correia <rafael.correia.poli@gmail.com>
- Loading branch information