avar / app-inotify-hookable

The App::Inotify::Hookable CPAN module
4 stars 2 forks source link

&& and || operators don't work #5

Closed RCoeurjoly closed 4 years ago

RCoeurjoly commented 4 years ago

Being test.py just assert True inotify-hookable -f test.py --on-modify-command 'python test.py && echo "Success!" || echo "Failure"' will only execute python test.py.

rkitover commented 4 years ago

Works fine for me.

When I run touch test.py this is what I see in my terminal:

rkitover@epyc  ➤  inotify-hookable -f test.py --on-modify-command 'python test.py && echo "Success!" || echo "Failure"'
Thu Apr  9 19:56:58 2020 : Starting up, watching files <test.py>
Thu Apr  9 19:56:58 2020 : FINISHED setting up watches. Took 0.00s with 1 watches added, 0 removed, 0 replaced. Have 1 total watches
Thu Apr  9 19:57:02 2020 : Had changes in your paths
Thu Apr  9 19:57:02 2020 : Running global hooks
Thu Apr  9 19:57:02 2020 : Running <python test.py && echo "Success!" || echo "Failure">
Success!
Thu Apr  9 19:57:02 2020 : FINISHED on-modify command. Took 0.03s
Thu Apr  9 19:57:02 2020 : FINISHED setting up watches. Took 0.00s with 0 watches added, 0 removed, 0 replaced. Have 1 total watchesThu Apr  9 19:57:07 2020 : Had changes in your paths
Thu Apr  9 19:57:07 2020 : Running global hooks
Thu Apr  9 19:57:07 2020 : Running <python test.py && echo "Success!" || echo "Failure">
Success!
Thu Apr  9 19:57:07 2020 : FINISHED on-modify command. Took 0.03s
Thu Apr  9 19:57:07 2020 : FINISHED setting up watches. Took 0.00s with 0 watches added, 0 removed, 0 replaced. Have 1 total watches
RCoeurjoly commented 4 years ago

Now it works fine for me too. It seems I did something wrong before. Sorry for the inconvenience.