Skip to content

withWorkingDir built-in #137

Description

@dfa1

Problem
Often in bash scripts I use this pattern:

DIR=build
rm -rf $DIR
mkdir -p $DIR
# use $DIR

to make sure that $DIR is an empty directory before using it.

Solution

introduce a new wrapper to be able to express same pattern, in a more intention revealing way:

withWorkingDir ${DIR} { }

that also cd into ${DIR}.

Benefit
To me advantage is clear but let's wait for some external input.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    commandrelated to a commandhelp wantedopen problem waiting for help/discussionincompletefurther information is required before starting implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions