fix(storage): retain explicit junction rejection when binding physical data roots
This commit is contained in:
@@ -97,7 +97,13 @@ export class Store extends EventEmitter {
|
||||
// A retained pre-desktop Store may still name an MSIX-virtualized LocalAppData
|
||||
// directory. Bind new path-scoped services to that same physical directory,
|
||||
// including when SQLite is already open; do not reopen or move its data.
|
||||
this.directory = fs.realpathSync.native(this.directory);
|
||||
const resolved = path.resolve(this.directory), parsed = path.parse(resolved);
|
||||
let current = parsed.root;
|
||||
for (const component of resolved.slice(parsed.root.length).split(path.sep).filter(Boolean)) {
|
||||
current = path.join(current, component);
|
||||
if (fs.lstatSync(current).isSymbolicLink()) throw new Error('任务数据目录不接受符号链接或目录联接。');
|
||||
}
|
||||
this.directory = fs.realpathSync.native(resolved);
|
||||
if (this.storage?.database) {
|
||||
const missing = CORE_KINDS.filter(kind => !this.core?.[kind]);
|
||||
if (missing.length) {
|
||||
|
||||
Reference in New Issue
Block a user