(repoRoot, artifact)
| 28 | } |
| 29 | |
| 30 | function 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 | |
| 45 | function parseArgs(argv) { |
| 46 | const parsed = {}; |
no outgoing calls
no test coverage detected