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

I just cannot make entr run two (or more) commands when triggered? #97

Closed
smhk opened this issue Aug 5, 2022 · 2 comments
Closed

I just cannot make entr run two (or more) commands when triggered? #97

smhk opened this issue Aug 5, 2022 · 2 comments

Comments

@smhk
Copy link

smhk commented Aug 5, 2022

I use entr like this

ls static/* views/* . | entr echo 1

and it works perfectly. However if I want to do this ...

ls static/* views/* . | entr echo 1 ; echo 2

I just cannot get it to work. I've tried

ls static/* views/* . | entr 'echo 1 ; echo 2'

example,

% ls static/* views/* . | entr 'echo 1 && echo 2'
entr: exec echo 1 && echo 2: No such file or directory

and every variation I can think of. Aliases don't work.

What the heck could the solution be??

My aim is simple, git commit -am 'auto' && git push

Thanks, sorry if trivial !

@smhk
Copy link
Author

smhk commented Aug 5, 2022

Resolved, it's

alias -g superotto="find \$PWD -name '.*' -prune -o -print | entr zsh -c \"git commit -am 'auto' && git push\""

works perfectly if put in .zsh

Perhaps it will help someone. Thanks and sorry for the bother!

@smhk smhk closed this as completed Aug 5, 2022
@eradman
Copy link
Owner

eradman commented Aug 5, 2022

I think you're being tripped up the the output of ls(1) since it doesn't print directory names by default. Try

ls -d static/* views/* | entr ...

Also note that globbing is performed by the shell, so this would work as well

echo static/* views/* | entr ...

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