Closed reggi closed 5 years ago
Here's an alternative idea, if a command is an object allow specific properties:
company.build-prod:
description: Build production
command: |
docker-compose exec api yarn run tsc --pretty --project tsconfig.production.json
company.single-test:
description: Run a single test
args:
file:
type: FILE
command: |
docker-compose exec api yarn test-pattern ${file}
@reggi Thanks for the suggestions!
As far as descriptions, it's already implemented (just not documented yet, sorry) using task meta-information syntax (<task-name>.<meta-key>
):
Project: aaa
build.Doc: Builds the system
build: |
./build
$ oya tasks
# in ./Oyafile
oya run anotherTask
oya run build # Builds the system
In general, we have ideas for more of these extensions (including declarative argument checking and task dependencies).
As far as arguments, while there's no way to validate them (yet), there are ways you can access them beyond what bash supports ($@
, $1
, etc.):
Project: foo
build.Doc: Builds the system
build: |
echo build ${Oya[Args.0]} ${Oya[Flags.all]} ${Oya[Flags.target]}
$ oya run build file.txt --all --target=ababa
build file.txt true ababa
Notice the ${Oya[xxx]}
syntax. Oya uses associative arrays in bash scripts to make it both compatible with regular bash 4 scripts & to avoid conflicts with existing env variables.
We need to document this. Created #67 to address it. I'm closing this issue but if anybody feels it should be reopen, please feel free to do so.
I'd love to see descriptions in the
oya tasks
command of what a task is.Then:
It would be nice to have descriptions and arguments.