coder / coder/registry

Add helper functions to print to log/print to stderr

Open
#46 7 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.