@sprucelabs/esm-postbuild 6.0.566 → 6.0.567

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.
@@ -28,14 +28,31 @@ function parseArgs() {
28
28
  help: 'Show this help message',
29
29
  };
30
30
  for (let i = 2; i < process.argv.length; i++) {
31
- const arg = process.argv[i];
31
+ let arg = process.argv[i];
32
32
  if (arg.startsWith('--')) {
33
- const [key, value] = arg.slice(2).split('=');
34
- args[key] = value === undefined ? true : value;
33
+ let key;
34
+ let value;
35
+ if (arg.includes('=')) {
36
+ ;
37
+ [key, value] = arg.slice(2).split('=');
38
+ }
39
+ else {
40
+ key = arg.slice(2);
41
+ // Only set value if next arg exists and doesn't start with --
42
+ if (process.argv[i + 1] &&
43
+ !process.argv[i + 1].startsWith('--')) {
44
+ value = process.argv[i + 1];
45
+ i++; // skip next arg
46
+ }
47
+ else {
48
+ value = true;
49
+ }
50
+ }
51
+ args[key] = value;
35
52
  }
36
53
  }
37
54
  if (args.help) {
38
- console.log('Usage: esm-postbuild [--target=dir] [--patterns=globs]');
55
+ console.log('Usage: esm-postbuild [--target dir] [--patterns globs]');
39
56
  console.log('\nOptions:');
40
57
  Object.entries(descriptions).forEach(([key, desc]) => {
41
58
  console.log(` --${key.padEnd(10)} ${desc}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprucelabs/esm-postbuild",
3
- "version": "6.0.566",
3
+ "version": "6.0.567",
4
4
  "description": "Script to do thins after build of esm modules",
5
5
  "main": "build/esm-postbuild.js",
6
6
  "repository": "git@github.com:sprucelabsai-community/esm-postbuild.git",