@henryqw/pi-open-in 0.1.0 → 0.1.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.
@@ -34,7 +34,11 @@ export default function openInExtension(pi: ExtensionAPI): void {
34
34
  pi.registerCommand("open", {
35
35
  description: `Open the current path with \`${command} <current-path>\``,
36
36
  handler: async (_args, ctx) => {
37
- await pi.exec(configuredCommand(), [ctx.cwd]);
37
+ const [executable, ...args] = configuredCommand().split(/\s+/);
38
+ const result = await pi.exec(executable, [...args, ctx.cwd]);
39
+ if (result.code !== 0) {
40
+ throw new Error(`Open command failed: ${result.stderr.trim() || `exit code ${result.code}`}`);
41
+ }
38
42
  },
39
43
  });
40
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-open-in",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Open the current Pi working directory with a configurable command.",
5
5
  "keywords": [
6
6
  "pi-package",