Add helper functions to print to log/print to stderr
Open
- Dominant language
- HCL
- Stars
- 79
- Forks
- 161
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 38
Description
While reviewing https://github.com/coder/modules/pull/329 I noticed we didn't print any errors to stderr. I suggest we add helper functions for this:
```sh
# lib
error() {
echo "ERROR: $@" >&2
exit 1 # (optional)
}
log() {
echo "$@"
}
```
Then use them where appropriate:
```sh
log "Installing package..."
install || error "Failed to install package"
```
// cc @matifali
Contributor guide
Assessment
This issue has not been assessed yet.