greptile 2.2.5 → 2.2.7
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/greptile-fix.applescript +5 -5
- package/health-server.js +18 -4
- package/package.json +1 -1
package/greptile-fix.applescript
CHANGED
|
@@ -41,15 +41,15 @@ on open location theURL
|
|
|
41
41
|
-- so we launch bash and source the runner script to keep the shell session alive
|
|
42
42
|
-- after the IDE command (claude/codex/cursor) finishes.
|
|
43
43
|
-- Unset CLAUDECODE so the new session doesn't think it's nested inside an existing one.
|
|
44
|
-
set cleanEnv to "unset CLAUDECODE; source " &
|
|
44
|
+
set cleanEnv to "unset CLAUDECODE; source " & runnerPath & " ; exec zsh"
|
|
45
45
|
if termApp is "Ghostty" then
|
|
46
|
-
do shell script "open -na Ghostty --args -e
|
|
46
|
+
do shell script "open -na Ghostty --args -e zsh -li -c '" & cleanEnv & "' &>/dev/null &"
|
|
47
47
|
else if termApp is "kitty" then
|
|
48
|
-
do shell script "open -na kitty --args
|
|
48
|
+
do shell script "open -na kitty --args zsh -li -c '" & cleanEnv & "' &>/dev/null &"
|
|
49
49
|
else if termApp is "WezTerm" then
|
|
50
|
-
do shell script "open -na WezTerm --args start --
|
|
50
|
+
do shell script "open -na WezTerm --args start -- zsh -li -c '" & cleanEnv & "' &>/dev/null &"
|
|
51
51
|
else if termApp is "Alacritty" then
|
|
52
|
-
do shell script "open -na Alacritty --args -e
|
|
52
|
+
do shell script "open -na Alacritty --args -e zsh -li -c '" & cleanEnv & "' &>/dev/null &"
|
|
53
53
|
else
|
|
54
54
|
-- Terminal.app, iTerm, and Warp natively execute scripts via "open -a"
|
|
55
55
|
do shell script "open -a " & quoted form of termApp & " " & quoted form of runnerPath
|
package/health-server.js
CHANGED
|
@@ -5,19 +5,33 @@ const path = require('path')
|
|
|
5
5
|
|
|
6
6
|
const PORT = 4747
|
|
7
7
|
|
|
8
|
-
// Self-destruct: if the package has been uninstalled
|
|
9
|
-
//
|
|
8
|
+
// Self-destruct: if the package has been uninstalled, clean up and exit.
|
|
9
|
+
// Checks that package.json next to this script still exists.
|
|
10
|
+
// Note: we intentionally don't check `command -v greptile-fix` because
|
|
11
|
+
// launchd runs with a minimal PATH that doesn't include npm global bin.
|
|
10
12
|
const PACKAGE_MARKER = path.join(__dirname, 'package.json')
|
|
11
13
|
const SELF_CHECK_INTERVAL_MS = 30_000
|
|
12
14
|
|
|
13
15
|
function selfCheck() {
|
|
14
|
-
|
|
16
|
+
const markerGone = !fs.existsSync(PACKAGE_MARKER)
|
|
17
|
+
|
|
18
|
+
if (markerGone) {
|
|
15
19
|
console.log('Package uninstalled — cleaning up and exiting.')
|
|
16
|
-
const
|
|
20
|
+
const { execSync } = require('child_process')
|
|
21
|
+
const home = process.env.HOME || ''
|
|
22
|
+
const plistPath = path.join(home, 'Library/LaunchAgents/com.greptile.health.plist')
|
|
23
|
+
// Remove .app bundle and plist file
|
|
24
|
+
try {
|
|
25
|
+
fs.rmSync(path.join(home, 'Applications/Greptile Fix.app'), { recursive: true, force: true })
|
|
26
|
+
} catch {}
|
|
17
27
|
try {
|
|
18
28
|
fs.unlinkSync(plistPath)
|
|
19
29
|
} catch {}
|
|
20
30
|
server.close()
|
|
31
|
+
// Remove the launchd job by label so KeepAlive won't restart us
|
|
32
|
+
try {
|
|
33
|
+
execSync('launchctl remove com.greptile.health 2>/dev/null')
|
|
34
|
+
} catch {}
|
|
21
35
|
process.exit(0)
|
|
22
36
|
}
|
|
23
37
|
}
|