From e4d83e7c02bc9de39b2940b98b5128ebb0844603 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Tue, 28 Apr 2026 10:23:27 -0400 Subject: [PATCH 1/2] Fix isLocalFolder() to allow symlinks to directories I'm trying to layer in a local feature for my developers to apply custom preferences to their devcontainers without polluting eachother's devcontainers. I want to use a symlink from `~/.devcontainer/personal-config` to the local repository's `.devcontainer/personal-config` and add: ``` { ... "features": { "./personal-config": {} } } ``` To the local repository's `.devcontainer/devcontainer.json`. Unfortunately, the current `isLocalFolder()` chokes on symlinks. This patch should allow symlinked directories for local features. I'm not a TypeScript programmer, and I'm not sure this is the exact implementation. I'm not a fan of async programming, especially for command line utilities with linear workflows, but the world lost it's mind and uses callback non-sense for straight forward problems, so here we are. --- src/spec-utils/pfs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spec-utils/pfs.ts b/src/spec-utils/pfs.ts index 1e42a927c..655b6f58a 100644 --- a/src/spec-utils/pfs.ts +++ b/src/spec-utils/pfs.ts @@ -15,7 +15,7 @@ export function isLocalFile(filepath: string): Promise { } export function isLocalFolder(filepath: string): Promise { - return new Promise(r => fs.stat(filepath, (err, stat) => r(!err && stat.isDirectory()))); + return new Promise(r => fs.realpath(filepath, (err,rpath) => r(!err && fs.stat(rpath, (err, stat) => r(!err && stat.isDirectory()))))); } export const readLocalFile = promisify(fs.readFile); From 1a3dd1067a9646b3b119a58e8001aead863414e6 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Tue, 28 Apr 2026 10:54:17 -0400 Subject: [PATCH 2/2] Fix return value in inner callback --- src/spec-utils/pfs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spec-utils/pfs.ts b/src/spec-utils/pfs.ts index 655b6f58a..5036e3eb9 100644 --- a/src/spec-utils/pfs.ts +++ b/src/spec-utils/pfs.ts @@ -15,7 +15,7 @@ export function isLocalFile(filepath: string): Promise { } export function isLocalFolder(filepath: string): Promise { - return new Promise(r => fs.realpath(filepath, (err,rpath) => r(!err && fs.stat(rpath, (err, stat) => r(!err && stat.isDirectory()))))); + return new Promise(r => fs.realpath(filepath, (err,rpath) => r(!err && fs.stat(rpath, (err, stat) => (!err && stat.isDirectory()))))); } export const readLocalFile = promisify(fs.readFile);