Invalid shell option

Dear community,

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.

Thank you in advance

Couple other people had this issue with WSL as well: Deploy bedrock from windows to Digital Ocean with ansible

It’s obviously some problem with the bash environment but I don’t know the cause. So you can run the manual ansible command as a fix:

ansible-playbook deploy.yml -e "site=<site> env=<environment>"

You might also want to try out https://github.com/roots/trellis-cli which offers a nice deploy command with autocompletion :smile:

1 Like

Thank you @swalkinshaw for your answer!

I read this topic, is it the same to do it in this way? Nobody answers to this guy (actually the topic was a bit old).

I noticed this tool trellis-cli but I did not test it before. Isn’t it based on the bash scripts? I’ll figure it out :slight_smile:

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.

I read this topic, is it the same to do it in this way? Nobody answers to this guy (actually the topic was a bit old).

The deploy.sh bash script just calls ansible command so yes it’s the same.

trellis-cli is not bash based, it’s a native binary written in Go.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.