mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fix: skip snapshotting ../imports outside config dir to prevent rollback overwriting unrelated files
Co-Authored-By: mantra <mantra@stack-auth.com>
This commit is contained in:
parent
57e01d5720
commit
1b036b6915
@ -201,7 +201,9 @@ function snapshotConfigFiles(configFilePath: string, configContent: string): Con
|
||||
const dir = path.dirname(configFilePath);
|
||||
const snapshots: ConfigFileSnapshot[] = [{ path: path.resolve(configFilePath), content: configContent }];
|
||||
for (const specifier of getRelativeImportSpecifiers(configContent)) {
|
||||
captureSnapshotIfAbsent(snapshots, path.resolve(dir, specifier));
|
||||
const resolved = path.resolve(dir, specifier);
|
||||
if (!isPathInsideDir(dir, resolved)) continue;
|
||||
captureSnapshotIfAbsent(snapshots, resolved);
|
||||
}
|
||||
return snapshots;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user