Skip to content

use POSIX parameter expansion for assigning default values #202

@umlaeute

Description

@umlaeute

the modules are full of default-assignments like so:

[ -n "$BASE_IMAGE_RASPBIAN" ] || BASE_IMAGE_RASPBIAN=yes

this is obviously not a bug, but i think the readability could be improved by using POSIX parameter expansion.

the following is equivalent to the test-clause above:

: ${BASE_RELEASE_COMPRESS:=yes}

from the bash manpage:

${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Positional parameters and special parameters may not be assigned to in this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions