craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

Adds the run command #439

Closed jasonmccallister closed 2 years ago

jasonmccallister commented 2 years ago

Description

Adds the run command in Nitro which allows running any image anywhere with sensible syntax around the docker run command.

If you need to run a composer command on a host directory, not tied to an app, the run command could be used like so:

nitro run --image composer --interactive help
timkelty commented 2 years ago

This looks good, but we should resolve the passing of extra arguments into the command issue before merging. Otherwise, it's fairly limited.

@jasonmccallister what about adding a --command arg, so instead of:

// doesn't work because cobra validates --prefix as a flag
nitro run --image node:10 npm run build --prefix=/app/

We do:

nitro run --image node:10 --command "npm run build --prefix=/app/"
jasonmccallister commented 2 years ago

@angrybrad merged in @timkelty's PR with the --command flag