Skip to content

Commit 361f73b

Browse files
committed
chore: start switching to yargs for destroy script
1 parent 5add4b8 commit 361f73b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

bin/destroy.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import * as path from 'path'
44
import { realpathSync } from 'fs'
55
import { fileURLToPath, pathToFileURL } from 'url'
66
import { spawnSync, SpawnSyncReturns } from 'child_process'
7-
import { createRequire } from 'node:module'
7+
import { createRequire } from 'module'
88

9-
import parseArgs from 'minimist'
9+
import yargs from 'yargs/yargs';
1010

1111
import { AWSAdapterProps } from '../adapter'
1212

@@ -16,7 +16,18 @@ export async function main(args: string[]): Promise<void> {
1616
let pulumiPaths: string[] | undefined
1717
let stackName: string | undefined
1818

19-
const argv = parseArgs(args.slice(2))
19+
var argv = yargs(process.argv.slice(2))
20+
.usage('Usage: $0 [options]')
21+
.command('$0', 'Destroy the pulumi stacks for sveltekit-adapter-aws-pulumi')
22+
.example('$0', 'count the lines in the given file')
23+
.alias('f', 'file')
24+
.nargs('f', 1)
25+
.describe('f', 'Load a file')
26+
.demandOption(['f'])
27+
.help('h')
28+
.alias('h', 'help')
29+
.epilog('copyright 2019')
30+
.argv;
2031

2132
let artifactPath = 'build'
2233

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@types/mime": "^3.0.1",
4646
"@types/minimist": "^1.2.2",
4747
"@types/node": "18.14.0",
48+
"@types/yargs": "^17.0.24",
4849
"@vitest/coverage-c8": "^0.29.8",
4950
"copyfiles": "^2.4.1",
5051
"prettier": "^2.8.4",
@@ -59,8 +60,8 @@
5960
"dotenv": "^16.0.3",
6061
"folder-hash": "^4.0.4",
6162
"lodash": "^4.17.21",
62-
"minimist": "^1.2.8",
63-
"sveltekit-adapter-aws-base": "^2.1.1"
63+
"sveltekit-adapter-aws-base": "^2.1.1",
64+
"yargs": "^17.7.1"
6465
},
6566
"release": {
6667
"branches": [

0 commit comments

Comments
 (0)