cadet-agent 0.20.1 → 0.20.2
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 +1 -1
- package/src/install.mjs +13 -9
package/package.json
CHANGED
package/src/install.mjs
CHANGED
|
@@ -276,15 +276,19 @@ function matchesManagedPath(filename, managedPaths) {
|
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
function walkDir(dir, fn) {
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
279
|
+
const root = dir;
|
|
280
|
+
const walk = (current) => {
|
|
281
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
282
|
+
const fullPath = join(current, entry.name);
|
|
283
|
+
if (entry.isDirectory()) {
|
|
284
|
+
walk(fullPath);
|
|
285
|
+
} else {
|
|
286
|
+
// rel must be relative to the walked root, not the current subdirectory
|
|
287
|
+
fn(fullPath, relative(root, fullPath));
|
|
288
|
+
}
|
|
286
289
|
}
|
|
287
|
-
}
|
|
290
|
+
};
|
|
291
|
+
walk(root);
|
|
288
292
|
}
|
|
289
293
|
|
|
290
294
|
function deleteObsoleteManagedFiles(targetDir, managedPaths, zipFilenames) {
|
|
@@ -320,7 +324,7 @@ function deleteObsoleteManagedFiles(targetDir, managedPaths, zipFilenames) {
|
|
|
320
324
|
return deleted;
|
|
321
325
|
}
|
|
322
326
|
|
|
323
|
-
async function extractZipWithManifest(buf, targetDir, { preserved, managed }) {
|
|
327
|
+
export async function extractZipWithManifest(buf, targetDir, { preserved, managed }) {
|
|
324
328
|
const eocdOff = findEocd(buf);
|
|
325
329
|
const cdSize = read32(buf, eocdOff + 12);
|
|
326
330
|
const cdOff = read32(buf, eocdOff + 16);
|