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

Make globbing with --bin possible #150

Open
ajsalminen opened this issue Sep 13, 2017 · 1 comment
Open

Make globbing with --bin possible #150

ajsalminen opened this issue Sep 13, 2017 · 1 comment

Comments

@ajsalminen
Copy link

Currently this seems to work for linking a bunch of files into a directory:

fresh mutt/\* --file=.mutt/

It would be nice to be able to do the same with bin and avoid naming each individual script in freshrc.
fresh bin/\* --bin=bin/

@jasoncodes
Copy link
Member

Globbing to directory targets are currently not supported features for either --file or --bin. This is something I would like fresh to support at some point so thanks for feature request. You can work around this limitation right now by writing a loop in your freshrc:

for FILE in "$FRESH_LOCAL/mutt/"*; do
  fresh "mutt/$(basename "$FILE")" --file=".mutt/$(basename "$FILE")"
done

I noticed you are using relative target paths in both your examples. A relative path on --file writes into ~/.fresh/build without linking the built files out to your home directory. Is this what you are intending to do? I want to confirm whether you expect the above examples to write to ~/.mutt/ and ~/bin or not. If this is what you are expecting, ~/ will need to be prepending to the target paths.

Also, --bin with a relative path should currently be failing with an “--bin file paths cannot be relative” error message whether or not you have a glob in the source path. This is something we can look into supporting if this would be a valuable feature to you. Right now though you could work around this using a fresh_after_build callback to chmod +x the appropriate files in ~/.fresh/build.

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

2 participants