mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-04 15:57:33 +01:00
docs(autoplan): canonicalRequested comment matches realpath behavior
realpathSync resolves a leaf link as well as directory links; only a missing target or dangling link keeps the literal spelling. Note why resolving a leaf link cannot bind an aliased active plan, and drop Read from the callers list (only Write/Edit use it). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a833426425
commit
134cd430fd
1 file changed
+4
-3
@@ -44,9 +44,10 @@ const samePath = (a: unknown, b: unknown): boolean => sameNativePath(a, b);
|
||||
const requestedPath = (cwd: string, file: string) =>
|
||||
nativePathSpelling(path.resolve(cwd, file.replace(/^~(?=[\\/]|$)/, () => os.homedir())));
|
||||
/**
|
||||
* The file a Write/Edit/Read path names, with directory links resolved, so a
|
||||
* symlinked plan directory compares equal to init's canonical paths. A missing or
|
||||
* leaf-linked target falls back to the literal spelling.
|
||||
* The file a Write/Edit path names, realpathed so a symlinked plan directory
|
||||
* compares equal to init's canonical paths. realpath resolves a leaf link too; a
|
||||
* missing target or dangling link keeps the literal spelling. An aliased active
|
||||
* plan never binds, because invocation() reads it through read(), which denies aliases.
|
||||
*/
|
||||
const canonicalRequested = (cwd: string, file: unknown): string | undefined => {
|
||||
if (typeof file !== 'string') return;
|
||||
|
||||
Reference in new issue
Block a user