Skip to content

Make it easier to export attributes #57

@TekWizely

Description

@TekWizely

In order to actually use attributes in scripts, commands need to first convert them into environment variables, which often leads to verbose assignments like:

(assumes #55 merged)

export RUNFILE_DIR := ${.RUNFILE.DIR}

Perhaps we can make exporting attributes easier for the user:

Quick Export

A quick export could be as easy as:

##
# export .RUNFILE.DIR
#
main:
    echo $RUNFILE_DIR

ie. the quick export rules could be:

  • Ignore the leading .
  • Replace . with _

Export With Rename

We could also support an easy way to export with a different name:

##
# export .RUNFILE.DIR as RFD
#
main:
    echo $RFD

Support Variables Too?

The as syntax could also be used as a way to export standard variables with a different name.

Although I'm not sure how useful this would be?

Even if its not overly useful, we might want to support it just for symmetry with attributes

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