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
Hi. I'm trying to write some simpler wrappers around native Shelly behavior, namely to have errExit True functionality, but without printing stack traces. It's a pretty simple wrap around runing commands, but it requires me to check the current state, something like:
--| A version of Shelly's 'run' that avoids printing out a stack trace on errorrun'::FilePath-> [T.Text] ->ShT.Text
run' fp args =do
e <- sErrExit <$> get
stdo <- errExit False$ run fp args
ex <- lastExitCode
if e && ex >0then lastStdErr >>= errorExit'
elsereturn stdo
--| A version of Shelly's 'errorExit' without debug informationerrorExit'::T.Text->Sha
errorExit' err = echo_err err >> quietExit 1
The problem is, State(..) is not exported from any exposed modules, so we have no way to deconstruct the a value of type State. Or more simply, in this example, I don't have access to sErrExit.
I see that you exported both get and set but these are useless without being able to access values in the return value of get. What are your thoughts? Is there a reason these are not exported?
The text was updated successfully, but these errors were encountered:
I am quite open to exporting everything under an Internal module. State has always been treated as something that is not an interface, the interface approach would probably be to create a specific getter or settter.
I just wondered about the same, since I wanted my custom command to take the sFollowSymlink property into account. Saw that get is exported, and wondered what to do with it.
Hi. I'm trying to write some simpler wrappers around native Shelly behavior, namely to have
errExit True
functionality, but without printing stack traces. It's a pretty simple wrap aroundrun
ing commands, but it requires me to check the current state, something like:The problem is,
State(..)
is not exported from any exposed modules, so we have no way to deconstruct the a value of typeState
. Or more simply, in this example, I don't have access tosErrExit
.I see that you exported both
get
andset
but these are useless without being able to access values in the return value ofget
. What are your thoughts? Is there a reason these are not exported?The text was updated successfully, but these errors were encountered: