Skip to content

Commit

Permalink
Parameterized goals #115
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 25, 2023
1 parent 2dcedff commit d748796
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/parameterized_goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Should work as expected. `@doc` should just copy to instantiated goals.
- [x] all errors at once
- [ ] TODOS
- [ ] validate param name (regex)
- [ ] handle + test w/ `@private`
- [x] handle + test w/ `@private`
- [ ] test w/ `@lib`
- [ ] test w/ `@doc`
- [x] handle + test w/ `@reached_if`
Expand Down
2 changes: 1 addition & 1 deletion makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function calcGlob(goalName, pattern, script, file) {
quicksort(GlobFiles,0,arrLen(GlobFiles)-1)
}

function isPriv() { return "@private" == $NF }
function isPriv() { if ("@private" != $NF) return 0; NF--; return 1 }

function handleGoalGlob( goalName,globAllGoal,globSingle,priv,i,pattern) {
started("goal_glob")
Expand Down
1 change: 0 additions & 1 deletion tests/27_parameterized_goals.tush
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh e
$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -l
| Available goals:
| a
| b@hello
| c@hello

$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -la
Expand Down
2 changes: 1 addition & 1 deletion tests/27_parameterized_goals_2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@goal a
@depends_on b @args 'hello'

@goal b @params S
@goal b @params S @private
@depends_on c @args S
echo "$S world from b"

Expand Down

0 comments on commit d748796

Please sign in to comment.