Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add .RUNFILE.DIR, .SELF, .SELF.DIR #55

Merged
merged 3 commits into from
Jul 25, 2022
Merged

Conversation

TekWizely
Copy link
Owner

@TekWizely TekWizely commented Jul 22, 2022

Adds new attributes:

  • .RUNFILE.DIR
  • .SELF
  • .SELF.DIR

chore: Adds config properties:

  • config.RunfileAbsDir
  • config.CurrentRunfile
  • config.CurrentRunfileAbs
  • config.CurrentRunfileAbsDir

bug: Fixes defer in for loop

TODO:

  • Update README

Fixes #52
cc: @rburchell , @nikolay : Wanna give this a try and see how the chosen attributes feel in use?

Adds new attributes:
- .RUNFILE.DIR
- .SELF.RUNFILE
- .SELF.DIR

chore: Adds config properties:
- config.RunfileAbsDir
- config.CurrentRunfile
- config.CurrentRunfileAbs
- config.CurrentRunfileAbsDir

bug: Fixes defer in for loop
@nikolay
Copy link

nikolay commented Jul 22, 2022

@TekWizely Is it .SELF.DIR or actually .SELF.RUNFILE.DIR?

@nikolay
Copy link

nikolay commented Jul 22, 2022

@TekWizely .SELF.DIR would be consistent with .DIR and not .RUNFILE.DIR, I think.

@TekWizely
Copy link
Owner Author

@TekWizely Is it .SELF.DIR or actually .SELF.RUNFILE.DIR?

As you likely already confirmed, Its:

	rf.Scope.PutAttr(".SELF.DIR", config.CurrentRunfileAbsDir)

@TekWizely .SELF.DIR would be consistent with .DIR and not .RUNFILE.DIR, I think.

Plain .DIR would make more sense as the user's CWD (which is not always the same as .RUNFILE.DIR) and is in fact not a bad idea which I should probably open a ticket for further discussion, so thanks for mentioning it.

Now I suppose an argument could be made to use plain .SELF instead of .SELF.RUNFILE for the filename, then you would have more symmetry .RUNFILE

Actually, now that I've written it I'm already leaning towards that idea, so expect an update soon :)

Nikolay wrote:

...as later on more attributes to .SELF could be added

I like the potential for .SELF to possibly contain other relevant attributes over time.

Similarly, this PR also opens up .RUNFILE to do the same, i.e. become a namespace for relevant runfile-level attributes over time.

Thanks for the note, I hope to continue the discussion and get this feature firmed up and merged soon,

-TW

@TekWizely TekWizely changed the title feat: Add RUNFILE.DIR, SELF.RUNFILE, SELF.DIR feat: Add RUNFILE.DIR, SELF, SELF.DIR Jul 22, 2022
@TekWizely TekWizely changed the title feat: Add RUNFILE.DIR, SELF, SELF.DIR feat: Add .RUNFILE.DIR, .SELF, .SELF.DIR Jul 22, 2022
@TekWizely
Copy link
Owner Author

cc: @rburchell , @nikolay

OK I've added some minimally viable documentation of the available attributes.

I think it makes this PR sufficient for merging, but would not mind a sign off from one or both of you as well.

-TW

@TekWizely TekWizely merged commit e28963e into master Jul 25, 2022
@TekWizely TekWizely deleted the runfile_current branch July 25, 2022 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding a .RUNFILEDIR attribute
2 participants