arisa 5.1.65 → 5.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
rename,
|
|
12
12
|
rm
|
|
13
13
|
} from "node:fs/promises";
|
|
14
|
-
import os from "node:os";
|
|
15
14
|
import path from "node:path";
|
|
16
15
|
import { getToolDir } from "../../runtime/paths.js";
|
|
17
16
|
import { normalizeToolDependencies, resolveToolDependencyPlan, satisfiesToolVersion } from "./tool-dependencies.js";
|
|
@@ -181,7 +180,7 @@ export async function installLockedOfficialTool({
|
|
|
181
180
|
toolName,
|
|
182
181
|
lock,
|
|
183
182
|
destination,
|
|
184
|
-
scratchRoot
|
|
183
|
+
scratchRoot,
|
|
185
184
|
checkout = checkoutRepository,
|
|
186
185
|
installDependencies = installPackageDependencies,
|
|
187
186
|
validate = validateEntrypoint
|
|
@@ -190,7 +189,9 @@ export async function installLockedOfficialTool({
|
|
|
190
189
|
if (await exists(destination)) {
|
|
191
190
|
throw new Error(`Refusing to overwrite installed tool: ${destination}`);
|
|
192
191
|
}
|
|
193
|
-
const
|
|
192
|
+
const stagingRoot = scratchRoot || path.dirname(destination);
|
|
193
|
+
await mkdir(stagingRoot, { recursive: true });
|
|
194
|
+
const scratch = await mkdtemp(path.join(stagingRoot, `.arisa-${toolName}-`));
|
|
194
195
|
const checkoutDir = path.join(scratch, "repository");
|
|
195
196
|
const stageDir = path.join(scratch, "stage");
|
|
196
197
|
try {
|
|
@@ -84,6 +84,7 @@ test("installs a verified staged tree without overwriting an existing tool", asy
|
|
|
84
84
|
const { root, source, files } = await fixture(t);
|
|
85
85
|
const destination = path.join(root, "installed", "master-slave");
|
|
86
86
|
const checkout = async ({ checkoutDir }) => {
|
|
87
|
+
assert.equal(path.dirname(path.dirname(checkoutDir)), path.dirname(destination));
|
|
87
88
|
await mkdir(path.join(checkoutDir, "tools"), { recursive: true });
|
|
88
89
|
await cp(source, path.join(checkoutDir, "tools", "master-slave"), { recursive: true });
|
|
89
90
|
};
|
|
@@ -92,7 +93,6 @@ test("installs a verified staged tree without overwriting an existing tool", asy
|
|
|
92
93
|
toolName: "master-slave",
|
|
93
94
|
lock: lock(files),
|
|
94
95
|
destination,
|
|
95
|
-
scratchRoot: root,
|
|
96
96
|
checkout,
|
|
97
97
|
installDependencies: async () => { lifecycle.push("dependencies"); },
|
|
98
98
|
validate: async () => { lifecycle.push("validate"); }
|