Use OS-specific path separator for hooks
Fixes https://github.com/tus/tusd/issues/206
This commit is contained in:
parent
6a474ce89e
commit
1b756f0239
|
@ -146,7 +146,8 @@ func invokeHttpHook(name string, typ HookType, info tusd.FileInfo, captureOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
func invokeFileHook(name string, typ HookType, info tusd.FileInfo, captureOutput bool) ([]byte, error) {
|
func invokeFileHook(name string, typ HookType, info tusd.FileInfo, captureOutput bool) ([]byte, error) {
|
||||||
cmd := exec.Command(Flags.FileHooksDir + "/" + name)
|
hookPath := Flags.FileHooksDir + string(os.PathSeparator) + name
|
||||||
|
cmd := exec.Command(hookPath)
|
||||||
env := os.Environ()
|
env := os.Environ()
|
||||||
env = append(env, "TUS_ID="+info.ID)
|
env = append(env, "TUS_ID="+info.ID)
|
||||||
env = append(env, "TUS_SIZE="+strconv.FormatInt(info.Size, 10))
|
env = append(env, "TUS_SIZE="+strconv.FormatInt(info.Size, 10))
|
||||||
|
|
Loading…
Reference in New Issue