Keep managed source paths canonical across outer workbench aliases (#713)
This commit is contained in:
parent
e13fde36fb
commit
31d155fd88
@@ -156,6 +156,26 @@ test(
|
||||
);
|
||||
assert.equal(graph.resources[0].directory, "resources/Named");
|
||||
assert.equal(graph.directResources[0].directory, "resources/Named");
|
||||
const alias = `${workbench}-guest-alias`;
|
||||
await fs.symlink(workbench, alias);
|
||||
context.after(() => fs.unlink(alias));
|
||||
const graphFile = path.join(workbench, ".quixos/resource-graph.json");
|
||||
await fs.writeFile(
|
||||
graphFile,
|
||||
JSON.stringify({
|
||||
...graph,
|
||||
resources: graph.resources.map((entry: { directory: string }) => ({
|
||||
...entry,
|
||||
directory: path.join(alias, entry.directory),
|
||||
})),
|
||||
}),
|
||||
);
|
||||
assert.equal((await discoverUpgradeSpec(alias)).nodes[1]!.directory, "resources/Named");
|
||||
const aliasPlan = await planPinUpgrades(alias, { ...(await discoverUpgradeSpec(alias)), bootstrap: true });
|
||||
await applyPinUpgrades(aliasPlan);
|
||||
const refreshed = JSON.parse(await fs.readFile(graphFile, "utf8"));
|
||||
assert.equal(refreshed.resources[0].directory, "resources/Named");
|
||||
assert.equal(refreshed.directResources[0].directory, "resources/Named");
|
||||
// A retained workbench can move without keeping its original absolute path
|
||||
// alive. Recovery journals remain bound to their original writer/root.
|
||||
const relocated = `${workbench}-relocated`;
|
||||
|
||||
Reference in New Issue
Block a user