@quadient/skillshare 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1032,11 +1032,21 @@ async function openBrowser(url) {
1032
1032
  return;
1033
1033
  }
1034
1034
  if (process.platform === 'win32') {
1035
- const result = await runProcess('cmd', ['/c', 'start', '', url], { allowFailure: true });
1036
- if (result.exitCode !== 0) {
1037
- throw new Error(result.stderr.trim() || 'Failed to open browser.');
1035
+ for (const [command, args] of [
1036
+ ['explorer.exe', [url]],
1037
+ ['rundll32.exe', ['url.dll,FileProtocolHandler', url]],
1038
+ ]) {
1039
+ try {
1040
+ const result = await runProcess(command, args, { allowFailure: true });
1041
+ if (result.exitCode === 0) {
1042
+ return;
1043
+ }
1044
+ }
1045
+ catch {
1046
+ // Try the next opener.
1047
+ }
1038
1048
  }
1039
- return;
1049
+ throw new Error('Failed to open browser.');
1040
1050
  }
1041
1051
  const result = await runProcess('xdg-open', [url], { allowFailure: true });
1042
1052
  if (result.exitCode !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadient/skillshare",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Skillshare CLI for installing and publishing Quadient skills",
5
5
  "type": "module",
6
6
  "bin": {