MCPcopy Create free account
hub / github.com/PatrickJS/awesome-cursorrules / resolveLocalArtifact

Function resolveLocalArtifact

scripts/cleanup-legacy-artifacts.mjs:30–43  ·  view source on GitHub ↗
(repoRoot, artifact)

Source from the content-addressed store, hash-verified

28}
29
30function resolveLocalArtifact(repoRoot, artifact) {
31 if (isAbsolute(artifact)) {
32 throw new Error(`Refusing to remove non-local artifact: ${artifact}`);
33 }
34
35 const resolved = resolve(repoRoot, artifact);
36 const localPath = relative(repoRoot, resolved);
37
38 if (localPath === "" || localPath.startsWith("..") || isAbsolute(localPath)) {
39 throw new Error(`Refusing to remove non-local artifact: ${artifact}`);
40 }
41
42 return { artifact, resolved };
43}
44
45function parseArgs(argv) {
46 const parsed = {};

Callers 1

cleanupLegacyArtifactsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected