You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Personally I've had some trouble because I tried to set power.sleep.computer = 240;. That is identical to systemsetup -setComputerSleep 240, which obviously fails because The time specified must be between 0 and 180 minutes(the actual error message from the command). The activation script sets -e, and as the output gets redirected like &> /dev/null, I didn't even notice that something's gone wrong after I darwin-rebuild switched. I spent hours, days, finally figuring out what actually happened. It would be significantly helpful to other users too to let the error message displayed at least on non-zero codes.
Potential fixes
I've come up with two instant ideas.
Don't redirect at all
I guess the rationale behind the redirection was not to overwhelm the user with excessive outputs. Given that, I don't think this would be the best idea, but at least it's simple, easy, and resolves the issue addressed here.
Keep outputs somewhere and display them on errors
Something like:
tmp="$(mktemp)"if! do_something &>"${tmp}";then
cat "${tmp}">&2exit 1
fi
This is way longer and more complex than do_something &>/dev/null. Is this the best fix? Is it good at all? I don't know. If somebody somehow fixes this, I'm more than happy to see this resolved. I'd very much appreciate if Co-authored-by would be a good fit.
Range of the issue
GitHub search currently shows me 9 files to be using the redirection. I'm not very sure how many of them should be fixed.
The text was updated successfully, but these errors were encountered:
Summary
Currently, it seems that
systemsetup
results are redirected into/dev/null
. This leads tosystemsetup
error messages being entirely hidden.Context
Personally I've had some trouble because I tried to set
power.sleep.computer = 240;
. That is identical tosystemsetup -setComputerSleep 240
, which obviously fails becauseThe time specified must be between 0 and 180 minutes
(the actual error message from the command). The activation script sets-e
, and as the output gets redirected like&> /dev/null
, I didn't even notice that something's gone wrong after Idarwin-rebuild switch
ed. I spent hours, days, finally figuring out what actually happened. It would be significantly helpful to other users too to let the error message displayed at least on non-zero codes.Potential fixes
I've come up with two instant ideas.
I guess the rationale behind the redirection was not to overwhelm the user with excessive outputs. Given that, I don't think this would be the best idea, but at least it's simple, easy, and resolves the issue addressed here.
Something like:
This is way longer and more complex than
do_something &>/dev/null
. Is this the best fix? Is it good at all? I don't know. If somebody somehow fixes this, I'm more than happy to see this resolved. I'd very much appreciate ifCo-authored-by
would be a good fit.Range of the issue
GitHub search currently shows me 9 files to be using the redirection. I'm not very sure how many of them should be fixed.
The text was updated successfully, but these errors were encountered: