Skip to content

pleasew: config files resolved from $PWD instead of pleasew script directory #3473

@simonfxr

Description

@simonfxr

When pleasew is invoked from a path other than the repo root (e.g., ../repo/pleasew or /absolute/path/to/pleasew), it fails to find .plzconfig because it looks in $PWD rather than the directory where pleasew is located.

For me this looks like a bug.

It would be more sensible to do something like this instead:

PLZCONFDIR="$(dirname "$0")"
CONFIGS="$(cat <<- EOS
    ${PLZCONFDIR}/.plzconfig.local
    ${PROFILE:+${PLZCONFDIR}/.plzconfig.${PROFILE}}
    ${PLZCONFDIR}/.plzconfig_${OS}_${ARCH}
    ${PLZCONFDIR}/.plzconfig
    ${HOME}/.config/please/plzconfig
    /etc/please/plzconfig
EOS
)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions