Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow glob to be interpolated string to facilitate reuse #165

Closed
xonixx opened this issue Feb 21, 2024 · 0 comments
Closed

Allow glob to be interpolated string to facilitate reuse #165

xonixx opened this issue Feb 21, 2024 · 0 comments
Assignees
Milestone

Comments

@xonixx
Copy link
Owner

xonixx commented Feb 21, 2024

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant