Open robcxyz opened 10 months ago
Modify how paths are tracked and made available through special variables.
Proposal Status: wip
Issue Number: 244
Proposal Doc: path-tracking.md
There is some ambiguity about what the current directory is. Current logic is
If remote, current dir is in providers dir
If another dir, same thing but in that dir
Right now it is not clear what the current path / calling path actually is. This proposal will fix that.
Plan is to create a new path object and which stores all the path related data.
Variables:
current path
chdir
calling path
tackle path
The path of the tackle provider being used.
base / hooks_dir / tackle_file
Context
path:
current
directory
file
calling
tackle
hooks_dir
Call from dir, tackle file in parent, call to remote tackle file, use generate hook
current_path = calling_path = cwd
tackle_file = the providers dir based on xdg
tackle_hook_path = the base dir, wherever the hook was defined, either tackle file or .hooks dir
generate hook attempts imports of templates from tackle_file_path and outputs by default in the current_path
Call from dir, tackle file in parent, call to remote tackle file, use a declarative hook, use generate hook
Point is we have 2 situations,
Path Tracking
Modify how paths are tracked and made available through special variables.
Proposal Status: wip
Issue Number: 244
Proposal Doc: path-tracking.md
Overview
There is some ambiguity about what the current directory is. Current logic is
If remote, current dir is in providers dir
If another dir, same thing but in that dir
Right now it is not clear what the current path / calling path actually is. This proposal will fix that.
Solution
Plan is to create a new path object and which stores all the path related data.
Variables:
current path
chdir
calling path
tackle path
The path of the tackle provider being used.
base / hooks_dir / tackle_file
Schema
Context
path:
current
directory
file
calling
directory
file
tackle
directory
hooks_dir
file
Situations
Call from dir, tackle file in parent, call to remote tackle file, use generate hook
current_path = calling_path = cwd
tackle_file = the providers dir based on xdg
tackle_hook_path = the base dir, wherever the hook was defined, either tackle file or .hooks dir
generate hook attempts imports of templates from tackle_file_path and outputs by default in the current_path
Call from dir, tackle file in parent, call to remote tackle file, use a declarative hook, use generate hook
Point is we have 2 situations,