Skip to content

Consider .DIR attribute for current processes' working directory (CWD) #56

Description

@TekWizely

With #55 adding .RUNFILE.DIR to track the primary runfile's parent directory, and .SELF.DIR to track the current (primary or otherwise) runfile's parent directory, it opens the door to possibly adding attributes for other useful directories.

One that comes to mind is the current processes' working directory (PWD / CWD).

NOTE: The CWD is not always the same as the Runfile's parent directory, as there are many ways to invoke a runfile from outside the user's current directory (shebang mode, runfile roots, etc).

Easy to get to already

As with .RUNFILE.DIR, the user's PWD is already easily achievable without an attribute:

Runfile

.DIR := ${PWD}

##
# export MY_DIR := ${.DIR}
#
pwd:
	echo $MY_DIR

Possibly Different Value

As the code would use Go's os.GetWd() method to retrieve the value for the attribute, there's a chance that the attribute value could differ from $PWD

However, Go does check and use $PWD if it appears to be correct.

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