Skip to content

Commit 15a55b1

Browse files
authored
fix: keep preview path when merging tunnel config (#5)
1 parent 09b21e0 commit 15a55b1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ function readConfigFile(dir: string): Partial<TunnelConfig> {
5959
for (const fileName of [LEGACY_CONFIG_FILE, PRIMARY_CONFIG_FILE]) {
6060
try {
6161
const raw = readFileSync(resolve(dir, fileName), "utf-8");
62-
Object.assign(merged, normalizeConfig(JSON.parse(raw)));
62+
const next = normalizeConfig(JSON.parse(raw));
63+
for (const [key, value] of Object.entries(next)) {
64+
if (value !== undefined) {
65+
(merged as Record<string, unknown>)[key] = value;
66+
}
67+
}
6368
} catch {
6469
// Try next candidate.
6570
}

0 commit comments

Comments
 (0)