Skip to content

Commit

Permalink
Redesign @goal_glob #34
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Aug 23, 2021
1 parent 1bb39bb commit 94e833a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ BEGIN {
"@options" == $1 { handleOptions(); next }
"@define" == $1 { handleDefine(); next }
"@shell" == $1 { handleShell(); next }
"@goal" == $1 { handleGoal(); next }
"@goal_glob" == $1 { handleGoalGlob(); next }
"@goal" == $1 { if ("@glob" == $2 || "@glob" == $3) handleGoalGlob(); else handleGoal(); next }
"@doc" == $1 { handleDoc(); next }
"@depends_on" == $1 { handleDependsOn(); next }
"@reached_if" == $1 { handleReachedIf(); next }
Expand Down Expand Up @@ -193,6 +192,10 @@ function parseGoalLine( priv) {
function handleGoalGlob( goal_name,priv,i) {
started("goal_glob")
priv = parseGoalLine()
goal_name = $2; $2 = ""
if ("@glob" == goal_name) {
goal_name = ""
} else $3 = ""
calcGlob(trim($0))
for (i=0; i<arrLen(GlobFiles); i++){
registerGoal(GlobFiles[i], priv)
Expand Down
2 changes: 1 addition & 1 deletion tests/14_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
@depends_on a
@doc doc for b

@goal_glob 14_doc.tush
@goal @glob 14_doc.tush
@depends_on a b
@doc doc for glob
2 changes: 1 addition & 1 deletion tests/14_doc_multi2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

@goal_glob 14_doc.tush
@goal @glob 14_doc.tush
@doc d1
@doc d2
4 changes: 2 additions & 2 deletions tests/15_private.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ echo a
@goal b @private
echo b

@goal_glob 15_private.sh
@goal @glob 15_private.sh
echo $ITEM

@goal_glob 15_private.tush @private
@goal @glob 15_private.tush @private
echo $ITEM

0 comments on commit 94e833a

Please sign in to comment.