-
Notifications
You must be signed in to change notification settings - Fork 464
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
pre-create hook on Windows always return file not exists #267
Comments
I tried to pull the code and verify what was happening. Seems that cmd := exec.Command("powershell", hookPath) the script pointed by Since I'm new to Go, I don't know how to solve this situation, or how to go further |
Thanks for reporting this and sorry for the delayed response, I didn't have the time yet to debug this issue on my Windows machine. In the meantime I would have a few questions about your setup:
The hook system was mostly designed with a Linux setup in mind and not enough effort was spent on testing it on Windows sadly (as we all are no Windows developers in our daily life). |
I called them just
powershell scripts, because I need to execute some commands (in particular call a php script)
the hook file contains just an "echo" to see if was working echo ">>>>>>>>>>>>>>>>>>>>>>>>> hello" I had time to experiment a bit more, and I found that:
|
Oh, that's interesting.
Do the hooks work in this situation (when you name the file |
I'm doing some tests on that side |
The testing scenario was tusd version 0.11 executed as follows
For the I started from
I tried with
the result was
the second test I decided to edit a bit the source code of tusd to impose the
the third test The second test error made me think, and I gave a try with a batch file instead of a powershell script. I named the file With my surprise it was working, here is the log trace
I believe that |
Great, that's a nice find! So the hooks are working for you now if you are using Batch files?
Yes, Go's exec package does - on purpose - not use any system shell: https://golang.org/pkg/os/exec/#pkg-overview. You might be able to call Powershell scripts if you add |
I will test deeply in a real application, but adding the |
Perfect! It would be nice if you could report back your results, so we can update the documentation accordingly. |
Sorry for the delay. I did a full test and I confirm that all hooks are executed if the file has a |
No worries, thank you very much for help! I updated the docs here: 12f102a Are you issues now resolved and can we close this issue? |
yes |
I'm trying file hooks on Windows 10 and I always get an error while the
pre-create
hook is executingTo Reproduce
Steps to reproduce the behavior:
tusd.exe --hooks-dir .\hooks\win\
Expected behavior
Hook is executed
Setup details
Please provide following details, if applicable to your situation:
--hooks-dir .\hooks\win\
The text was updated successfully, but these errors were encountered: