ntfy-sh: fix sh not found in subscribe command
ntfy's CLI supports running a command for every incoming message via:
ntfy subscribe TOPIC COMMAND
See: https://docs.ntfy.sh/subscribe/cli/#run-command-for-every-message
The upstream source hardcodes `sh` as the script launcher in
`cmd/subscribe_unix.go` and `cmd/subscribe_darwin.go`:
```go
scriptLauncher = []string{"sh", "-c"}
```
On NixOS, `sh` is not available in $PATH, causing command execution
to fail with:
Command failed: exec: "sh": executable file not found in $PATH
Replace the hardcoded `sh` with nixpkgs' runtimeShell, which resolves
to the system's configured shell (typically bash).
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
mkdocs,
|
||||
python3,
|
||||
python3Packages,
|
||||
runtimeShell,
|
||||
}:
|
||||
|
||||
buildGoModule (
|
||||
@@ -71,6 +72,12 @@ buildGoModule (
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's# /bin/echo# echo#' Makefile
|
||||
substituteInPlace \
|
||||
cmd/subscribe_unix.go \
|
||||
cmd/subscribe_darwin.go \
|
||||
--replace \
|
||||
'scriptLauncher = []string{"sh", "-c"}' \
|
||||
'scriptLauncher = []string{"${runtimeShell}", "-c"}'
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
|
||||
Reference in New Issue
Block a user