Comments (8)
Hi,
Which version of macOS are you using? I've noticed on certain macOS machines this happens but not all. I've also never seen it happen on native Linux or WSL.
A workaround is to remove the u
in set -euo pipefail
on line 3. I'm thinking about pushing that up as a change too. Having set -u
protects you from having a script with unbound variables (common reasons for this are typos in variable names) but I guess some versions of Bash don't like it with $@
.
from docker-django-example.
Aha, interesting! I'm on macOS Catalina Version 10.15.7.
Removing the -u
option from line 3 did the trick.
I'm not well versed in shell parameter expansions; could this be a solution?
from docker-django-example.
If you run bash --version
what version do you get back?
In our case we're using ${@}
which will let you pass in 0 or more arguments from our script to the command we're calling. This way you can naturally pass in multiple arguments to a command just as you would if you called it directly.
Setting a default is a reasonable idea with $1 because it's only dealing with 1 argument.
If we set "${@:-}"
(an empty default) it's going to convert that to sending in ""
which will make the underlying command fail. If we don't use quotes then it's not going to work as intended (it won't get parsed correctly).
from docker-django-example.
running bash --version
produces:
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
I understand what you mean with the ${@}
vs the "${@}"
. This and this are great explanations for people looking at this in the future...
from docker-django-example.
I should probably bite the bullet and yank out the u
flag. Having it not work for a decent chunk of Mac users isn't a good alternative to having unbound variable protection. I remember researching how to do this once while keeping it in but coming up empty handed. Going to give it a day or so to think about it and then either remove u
or patch in a proper fix.
If anyone has any suggestions let me know.
from docker-django-example.
If I understand the run
file correctly, you have _dc
which is combined with the various functions to run the commands. For example, if a user wanted to run lint their code with flake8
, they would normally run
flake8 my_project
but since the website is inside the "web" docker container, you'd have to first specify docker-compose
and -exec
and -T
which you've cleverly handled with _dc
and cmd
. The "{@}"
in the flake8
function simply looks for additional arguments to flake8? But there is also an @
in the cmd
command itself. As a naive question, what is the actual command being run when I type in ./run flake8 --version
? Is it docker-compose exec web flake8 --version
?
from docker-django-example.
What is the actual command being run when I type in ./run flake8 --version? Is it docker-compose exec web flake8 --version
Yep you got it. The only difference would be if you were running it in an environment that lacks a TTY then docker-compose exec -T web flake8 --version
would be run instead.
from docker-django-example.
I decided to push the fix to the main branch. Here's the commit: d6dc0b6
I'd rather have the examples work for everyone as soon as possible. Can always add u
back at a later time if a proper workaround is discovered.
Thanks for the report. Going to close this.
from docker-django-example.
Related Issues (20)
- New project name psql role doesn't exist HOT 5
- ERROR: Service 'css' failed to build : COPY failed: forbidden path outside the build context: HOT 4
- Celery worker crashes HOT 2
- adding separate frontend spa (react/vue/etc) HOT 5
- Service 'worker' failed to build : Build failed HOT 2
- tailwindcss --watch is not detecting changes HOT 8
- Update README.md about need to "chown 1000 ./public*" HOT 5
- Double public and public_collected directories HOT 6
- freeze no longer used. HOT 1
- unbound variable HOT 13
- HTML templates reloading issue (TailwindCSS) HOT 31
- IPDB debugging HOT 4
- Code reloading stopped working consistently when updating HTML templates HOT 4
- docker compose build : Unable to locate package build-essential HOT 3
- Add `LOG_LEVEL` env var? HOT 3
- `postgres` setup HOT 2
- Getting Server Error (500) on debug=false on env file HOT 3
- Updating dependencies during development HOT 2
- Any interest in adding Sentry and/or Mailhog services? HOT 4
- [Error: EACCES: permission denied, mkdir '/app/public/css'] HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-django-example.