Skip to content

Allow glob to be interpolated string to facilitate reuse #165

@xonixx

Description

@xonixx

The idea is to be able to eliminate C-P /path/to/source:

@define FOLDER '/path/to/source'
@define OUT    '/path/to/target'

@goal list @glob '/path/to/source/*Test.php'
  echo "$ITEM"

@goal conv @glob '/path/to/source/*Test.php'
  awk -f php2cs.awk "$ITEM"

@goal convFiles @glob '/path/to/source/*Test.php'
  cs="$(basename "$ITEM" .php)"
  [[ $cs == 'SkipThisTest' ]] && exit
  awk -f php2cs.awk "$ITEM" > "$OUT/${cs}.cs"

So what do we want:

@define FOLDER '/path/to/source'
@define OUT    '/path/to/target'

@goal list @glob "$FOLDER/*Test.php"
  echo "$ITEM"

@goal conv @glob "$FOLDER/*Test.php"
  awk -f php2cs.awk "$ITEM"

@goal convFiles @glob "$FOLDER/*Test.php"
  cs="$(basename "$ITEM" .php)"
  [[ $cs == 'SkipThisTest' ]] && exit
  awk -f php2cs.awk "$ITEM" > "$OUT/${cs}.cs"

But atm this gives:

$ ./makesure -l
Wrong quoting: /path/to/source/*Test.php:
Makesurefile:5: @goal list @glob "$FOLDER/*Test.php"
Shell code is not allowed outside goals/libs:
Makesurefile:6:   echo "$ITEM"
Wrong quoting: /path/to/source/*Test.php:
Makesurefile:8: @goal conv @glob "$FOLDER/*Test.php"
Wrong quoting: /path/to/source/*Test.php:
Makesurefile:11: @goal convFiles @glob "$FOLDER/*Test.php"

This updates #141 to allow double-quoted "strings" only in three positions:

  • @define VAR "here"
  • @depends_on pg @args "here" "and here"
  • @goal g @glob "here"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions