Skip to content

Add helper functions to print to log/print to stderr #46

Open
@mafredri

Description

@mafredri

While reviewing coder/modules#329 I noticed we didn't print any errors to stderr. I suggest we add helper functions for this:

# lib
error() {
    echo "ERROR: $@" >&2
    exit 1 # (optional)
}

log() {
    echo "$@"
}

Then use them where appropriate:

log "Installing package..."
install || error "Failed to install package"

// cc @matifali

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions