HUGO

Shell exit codes

HI,
there is no documentation about hugo exit codes.

Want to use it in shell scripts.
0 for OK ??
other = error ??

“other” is for “not ok”. right. 0 is always ok in ALL shell scripts.

I looked through the code (look for exit in the hugo repository) and it seems that 0 is no error, 1 and -1 are errors. 1 as an error comes up if the hugo server fails and -1 in all other error cases. Then it seems, but I don’t know that for sure because I am not “versed” in Go and might miss details, that errors of used programs/libraries are send through to the output on failures. So if for instance PostCSS has some specific error codes with meaning, they might show up. Hugo itself only uses -1, 0 and 1.

Thanks, works nice.

0 = OK
!=0 = Not OK

For errors you get mostly -1, but I think you get -2 for “invalid command”.

Thanks, please put it in the DOCS :sunglasses:

Are you talking to me? :slight_smile:

1 Like

Well, you’re the only one here. Oh yeah? OK. Travis.