expo-repro-cleanup 0.0.3 → 0.0.4
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/cli.ts +44 -1
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import pc from 'picocolors';
|
|
4
|
+
import { parseArgs } from 'util';
|
|
5
|
+
|
|
6
|
+
import packageJson from './package.json' with { type: 'json' };
|
|
4
7
|
import { runCleanupAsync } from './src/index.js';
|
|
5
8
|
|
|
9
|
+
function showHelp() {
|
|
10
|
+
console.log(`${pc.bold('expo-repro-cleanup')} v${packageJson.version}
|
|
11
|
+
|
|
12
|
+
${packageJson.description}
|
|
13
|
+
|
|
14
|
+
Usage: expo-repro-cleanup [options] [project-root]
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
-h, --help Show this help message
|
|
18
|
+
--version Show version number
|
|
19
|
+
|
|
20
|
+
Arguments:
|
|
21
|
+
project-root Path to the project (default: current directory)`);
|
|
22
|
+
}
|
|
23
|
+
|
|
6
24
|
async function main() {
|
|
7
|
-
const
|
|
25
|
+
const { values, positionals } = parseArgs({
|
|
26
|
+
args: Bun.argv,
|
|
27
|
+
options: {
|
|
28
|
+
help: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
short: 'h',
|
|
31
|
+
},
|
|
32
|
+
version: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
strict: false,
|
|
37
|
+
allowPositionals: true,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (values.version) {
|
|
41
|
+
console.log(packageJson.version);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (values.help) {
|
|
46
|
+
showHelp();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const projectRoot = positionals[2] || process.cwd();
|
|
8
51
|
|
|
9
52
|
try {
|
|
10
53
|
await runCleanupAsync(projectRoot);
|