sentry-cli bash-hook fails if using perl and any error happens
CC @mitsuhiko
$ cat foo.sh
sentry-cli bash-hook > foo.txt
eval "$(sentry-cli bash-hook)"
exit 2
$ ./foo.sh
./foo.sh: eval: line 63: syntax error near unexpected token `>'
That's probably this line:
1> >(tee >(perl '-MPOSIX' -ne '$|++; print strftime("%Y-%m-%d %H:%M:%S %z: ", localtime()), "stdout: ", $_;' >> "$_SENTRY_LOG_FILE")) \
@armenzg do you have an idea which shell is executing this for you?
$SHELL says /bin/zsh
cat foo.sh
sentry-cli bash-hook > foo.txt
echo $SHELL
eval "$(sentry-cli bash-hook)"
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
@armenzg Per the docs, and per the name of the command being bash-hook, the bash-hook only supports being run in the bash shell. Using zsh is unsupported.
Fixing your problem is as simple as using bash to run the foo.sh script, like so:
$ bash foo.sh
You should receive the output: "error: No DSN provided" when running with bash.
See also https://github.com/getsentry/sentry-cli/issues/1848.