I am trying to deploy using trellis and I’ve been facing a problem while executing the command
./bin/deploy.sh <environment> <site>
The result is the following:
: invalid shell option nameopt: nullglob
./bin/deploy.sh: line 3: $’\r’: command not found
./bin/deploy.sh: line 6: $’\r’: command not found
./bin/deploy.sh: line 7: syntax error near unexpected token $'{\r'' '/bin/deploy.sh: line 7: show_usage() {
I did not find any solution neither on the net, on discourse or on any issue on Github. May you help me?
I use Windows, with WSL (Ubuntu), vagrant & ansible already works. And I already fixed the problem with the permissions.
Looks like a line ending issue in the script file. Ensure that line endings are UNIX (LF) style.
There is also the dos2unix tool.
Also ensure that the git/svn settings are correct (line endings, case sensitivity), especially when using these tools outside of WSL, so you don’t accidentally introduce line ending issues.