picosh 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picosh",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Hyper plugin: paste clipboard images as file paths",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -15,18 +15,42 @@ function findHyperCli() {
15
15
  return HYPER_CLI_PATHS.find((p) => fs.existsSync(p));
16
16
  }
17
17
 
18
- const cli = findHyperCli();
18
+ function installHyper() {
19
+ const platform = os.platform();
20
+ console.log('[picosh] Installing Hyper...');
21
+ try {
22
+ if (platform === 'win32') {
23
+ execSync('winget install vercel.Hyper --silent', {stdio: 'inherit'});
24
+ } else if (platform === 'darwin') {
25
+ execSync('brew install --cask hyper', {stdio: 'inherit'});
26
+ } else {
27
+ console.log('[picosh] Please install Hyper manually: https://hyper.is');
28
+ return false;
29
+ }
30
+ return true;
31
+ } catch (e) {
32
+ console.log('[picosh] Auto-install failed. Please install Hyper manually: https://hyper.is');
33
+ return false;
34
+ }
35
+ }
36
+
37
+ let cli = findHyperCli();
38
+
39
+ if (!cli) {
40
+ const installed = installHyper();
41
+ if (!installed) process.exit(0);
42
+ cli = findHyperCli();
43
+ }
19
44
 
20
45
  if (!cli) {
21
- console.log('[picosh] Hyper not found. Install Hyper first: https://hyper.is');
22
- console.log('[picosh] Then run: hyper i picosh');
46
+ console.log('[picosh] Hyper installed. Run `hyper i picosh` to activate the plugin.');
23
47
  process.exit(0);
24
48
  }
25
49
 
26
50
  try {
27
51
  console.log('[picosh] Registering plugin with Hyper...');
28
52
  execSync(`"${cli}" i picosh`, {stdio: 'inherit'});
29
- console.log('[picosh] Done! Restart Hyper to activate.');
53
+ console.log('[picosh] Done! Launch Hyper to start using picosh.');
30
54
  } catch (e) {
31
55
  console.log('[picosh] Could not auto-register. Run manually: hyper i picosh');
32
56
  }