I've noticed some improvements that could be done. The changes in this PR are:
- pacman, makepkg, git, bash commands are encapsulated by the
ShellCommandobject is a builder similar to the
- elevation to root can be done by setting a flag on the ShellCommand (elevated() method)
ShellCommandmethods return an AppResult (Result<T, AppError). This way we can define custom errors and pass those around
SilentUnwraptrait (this is the only way to define custom function on foreign types) which we can use to unwrap errors and exit the application without panicking.
- exit codes are defined in an enum. There's now an exit code for git and makepkg errors as well
internal::stringsmethods use generics to accept all types that implement
ToStringinstead of just strings
- switch the declaration of getuuid to using the libc wrapper instead
- pacman output is now colorized on ttys
Let me know if this change is too invasive because I've changed quite a bit.