ovsx 0.5.0 → 0.5.2

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/src/ovsx CHANGED
@@ -1,10 +1,10 @@
1
- #!/usr/bin/env node
2
-
3
- const semver = require('semver');
4
-
5
- if (semver.lt(process.versions.node, '14.0.0')) {
6
- console.error('ovsx requires at least NodeJS version 14. Check your installed version with `node --version`.');
7
- process.exit(1);
8
- }
9
-
10
- require('./main')(process.argv);
1
+ #!/usr/bin/env node
2
+
3
+ const semver = require('semver');
4
+
5
+ if (semver.lt(process.versions.node, '14.0.0')) {
6
+ console.error('ovsx requires at least NodeJS version 14. Check your installed version with `node --version`.');
7
+ process.exit(1);
8
+ }
9
+
10
+ require('./main')(process.argv);
package/src/publish.ts CHANGED
@@ -15,7 +15,7 @@ import { checkLicense } from './check-license';
15
15
  /**
16
16
  * Publishes an extension.
17
17
  */
18
- export async function publish(options: PublishOptions = {}): Promise<void> {
18
+ export async function publish(options: PublishOptions = {}): Promise<PromiseSettledResult<void>[]> {
19
19
  addEnvOptions(options);
20
20
  const internalPublishOptions = [];
21
21
  const packagePaths = options.packagePath || [undefined];
@@ -25,7 +25,8 @@ export async function publish(options: PublishOptions = {}): Promise<void> {
25
25
  internalPublishOptions.push({ ... options, packagePath: packagePath, target: target });
26
26
  }
27
27
  }
28
- await Promise.all(internalPublishOptions.map(publishOptions => doPublish(publishOptions)));
28
+
29
+ return Promise.allSettled(internalPublishOptions.map(publishOptions => doPublish(publishOptions)));
29
30
  }
30
31
 
31
32
  async function doPublish(options: InternalPublishOptions = {}): Promise<void> {
@@ -53,9 +54,9 @@ async function doPublish(options: InternalPublishOptions = {}): Promise<void> {
53
54
  }
54
55
 
55
56
  const name = `${extension.namespace}.${extension.name}`;
56
- let description = `${name} v${extension.version}`;
57
- if (options.target) {
58
- description += `@${options.target}`;
57
+ let description = `${name} v${extension.version}`;
58
+ if (extension.targetPlatform !== 'universal') {
59
+ description += `@${extension.targetPlatform}`;
59
60
  }
60
61
 
61
62
  console.log(`\ud83d\ude80 Published ${description}`);
@@ -71,16 +72,16 @@ interface PublishCommonOptions extends RegistryOptions {
71
72
  extensionFile?: string;
72
73
 
73
74
  /**
74
- * The base URL for links detected in Markdown files. Only valid with `packagePath`.
75
- */
75
+ * The base URL for links detected in Markdown files. Only valid with `packagePath`.
76
+ */
76
77
  baseContentUrl?: string;
77
78
  /**
78
- * The base URL for images detected in Markdown files. Only valid with `packagePath`.
79
- */
79
+ * The base URL for images detected in Markdown files. Only valid with `packagePath`.
80
+ */
80
81
  baseImagesUrl?: string;
81
82
  /**
82
- * Should use `yarn` instead of `npm`. Only valid with `packagePath`.
83
- */
83
+ * Should use `yarn` instead of `npm`. Only valid with `packagePath`.
84
+ */
84
85
  yarn?: boolean;
85
86
  /**
86
87
  * Mark this package as a pre-release. Only valid with `packagePath`.
@@ -110,7 +111,7 @@ interface InternalPublishOptions extends PublishCommonOptions {
110
111
  * Only one target for our internal command.
111
112
  * Target architecture.
112
113
  */
113
- target?: string;
114
+ target?: string;
114
115
 
115
116
  /**
116
117
  * Only one path for our internal command.
package/src/util.ts CHANGED
@@ -68,7 +68,7 @@ export function createTempFile(options: tmp.TmpNameOptions): Promise<string> {
68
68
  });
69
69
  }
70
70
 
71
- export function handleError(debug?: boolean, additionalMessage?: string): (reason: any) => void {
71
+ export function handleError(debug?: boolean, additionalMessage?: string, exit: boolean = true): (reason: any) => void {
72
72
  return reason => {
73
73
  if (reason instanceof Error && !debug) {
74
74
  console.error(`\u274c ${reason.message}`);
@@ -82,7 +82,10 @@ export function handleError(debug?: boolean, additionalMessage?: string): (reaso
82
82
  } else {
83
83
  console.error('An unknown error occurred.');
84
84
  }
85
- process.exit(1);
85
+
86
+ if (exit) {
87
+ process.exit(1);
88
+ }
86
89
  };
87
90
  }
88
91