greptile 2.0.0 → 2.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.
package/build-app.sh CHANGED
@@ -11,6 +11,12 @@
11
11
 
12
12
  set -euo pipefail
13
13
 
14
+ # Only run on macOS
15
+ if [ "$(uname)" != "Darwin" ]; then
16
+ echo "build-app.sh: Skipping (macOS only)"
17
+ exit 0
18
+ fi
19
+
14
20
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
15
21
  OUTPUT_DIR="${1:-$SCRIPT_DIR}"
16
22
  APP_NAME="Greptile Fix"
@@ -6,7 +6,7 @@
6
6
  -- 1. macOS sends us the greptile:// URL
7
7
  -- 2. We call greptile-fix CLI to parse the URL, resolve the repo path, and create a runner script
8
8
  -- 3. greptile-fix prints the runner script path to stdout
9
- -- 4. We open Terminal with the runner script using "open -a Terminal" (no Automation permission needed)
9
+ -- 4. We detect the user's terminal and open the runner script with "open -a <terminal>"
10
10
 
11
11
  on open location theURL
12
12
  try
@@ -14,10 +14,39 @@ on open location theURL
14
14
  set runnerPath to do shell script "PATH=/opt/homebrew/bin:/usr/local/bin:$PATH greptile-fix " & quoted form of theURL & " 2>> /tmp/greptile-fix.log"
15
15
 
16
16
  if runnerPath is not "" then
17
- -- Use "open -a Terminal" instead of "tell application Terminal" to avoid Automation permission
18
- do shell script "open -a Terminal " & quoted form of runnerPath
17
+ -- Detect terminal app: prefer frontmost if it's a terminal, else first running terminal, else Terminal.app
18
+ set termApp to "Terminal"
19
+ set knownTerminals to {"iTerm2", "Ghostty", "Warp", "kitty", "WezTerm", "Alacritty", "Terminal"}
20
+ -- Map process names to the app name expected by "open -a"
21
+ -- (iTerm2's process name is "iTerm2" but the app name is "iTerm")
22
+ set termAppNames to {"iTerm", "Ghostty", "Warp", "kitty", "WezTerm", "Alacritty", "Terminal"}
23
+ try
24
+ tell application "System Events"
25
+ set frontName to name of first application process whose frontmost is true
26
+ set runningApps to name of every application process whose background only is false
27
+ end tell
28
+ -- If the frontmost app is a known terminal, use it
29
+ set foundFront to false
30
+ repeat with i from 1 to count of knownTerminals
31
+ if frontName is equal to item i of knownTerminals then
32
+ set termApp to item i of termAppNames
33
+ set foundFront to true
34
+ exit repeat
35
+ end if
36
+ end repeat
37
+ -- Otherwise pick the first running terminal we recognize
38
+ if not foundFront then
39
+ repeat with i from 1 to count of knownTerminals
40
+ if item i of knownTerminals is in runningApps then
41
+ set termApp to item i of termAppNames
42
+ exit repeat
43
+ end if
44
+ end repeat
45
+ end if
46
+ end try
47
+ do shell script "open -a " & quoted form of termApp & " " & quoted form of runnerPath
19
48
  end if
20
49
  on error errMsg
21
- do shell script "echo '[ERROR] " & errMsg & "' >> /tmp/greptile-fix.log"
50
+ do shell script "echo '[ERROR] " & quoted form of errMsg & "' >> /tmp/greptile-fix.log"
22
51
  end try
23
52
  end open location
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greptile",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Bridge for Greptile code review 'Fix in Claude Code' and 'Fix in Codex' links",
5
5
  "bin": {
6
6
  "greptile-fix": "bin/greptile-fix.js"
@@ -28,10 +28,5 @@
28
28
  "ide"
29
29
  ],
30
30
  "license": "MIT",
31
- "homepage": "https://greptile.com",
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/greptileai/greptilia.git",
35
- "directory": "tools/greptile-cli"
36
- }
31
+ "homepage": "https://greptile.com"
37
32
  }
package/preuninstall.sh CHANGED
@@ -2,6 +2,11 @@
2
2
  #
3
3
  # preuninstall.sh — Removes the Greptile Fix .app bundle on npm uninstall.
4
4
 
5
+ # Only run on macOS
6
+ if [ "$(uname)" != "Darwin" ]; then
7
+ exit 0
8
+ fi
9
+
5
10
  APP_PATH="$HOME/Applications/Greptile Fix.app"
6
11
 
7
12
  if [ -d "$APP_PATH" ]; then