Skip to content

Commit

Permalink
Execute all args as a single command
Browse files Browse the repository at this point in the history
  • Loading branch information
jdickey committed Jul 26, 2019
1 parent 7bad2d9 commit e954e4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Jacob Lowe and contributors
Copyright (c) 2019 Jeff Dickey, Jacob Lowe and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Executes each command listed in the Action's args via bash -c.

```shell
action "Setup" {
uses = "jcblw/bash@master"
uses = "jdickey/bash@master"
args = ["cat <<<$MY_VAR > file.csv"]
}
```

### Acknowledgements

Based on [`jcblw/bash`](https://github.com/jcblw/bash); the only difference is that he read argument values using `"$@"` rather than `"$*"`. Using his original, multi-word commands such as `docker-compose exec web bin/rake` would need to be surrounded by quotes (`'docker-compose exec web bin/rake'`).
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

for cmd in "$@"; do
for cmd in "$*"; do
echo "Running '$cmd'..."
if bash -c "$cmd"; then
# no op
Expand Down

0 comments on commit e954e4e

Please sign in to comment.