greptile 2.2.5 → 2.2.6
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 +24 -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 " & quoted form of runnerPath & " ; exec
|
|
44
|
+
set cleanEnv to "unset CLAUDECODE; source " & quoted form of 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,39 @@ 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 two signals: 1) package.json next to this script is gone, or
|
|
10
|
+
// 2) greptile-fix is no longer in PATH (handles npm global uninstall).
|
|
10
11
|
const PACKAGE_MARKER = path.join(__dirname, 'package.json')
|
|
11
12
|
const SELF_CHECK_INTERVAL_MS = 30_000
|
|
12
13
|
|
|
13
14
|
function selfCheck() {
|
|
14
|
-
|
|
15
|
+
const markerGone = !fs.existsSync(PACKAGE_MARKER)
|
|
16
|
+
let cliGone = false
|
|
17
|
+
try {
|
|
18
|
+
const { execSync } = require('child_process')
|
|
19
|
+
execSync('command -v greptile-fix', { stdio: 'ignore' })
|
|
20
|
+
} catch {
|
|
21
|
+
cliGone = true
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (markerGone || cliGone) {
|
|
15
25
|
console.log('Package uninstalled — cleaning up and exiting.')
|
|
16
|
-
const
|
|
26
|
+
const { execSync } = require('child_process')
|
|
27
|
+
const home = process.env.HOME || ''
|
|
28
|
+
const plistPath = path.join(home, 'Library/LaunchAgents/com.greptile.health.plist')
|
|
29
|
+
// Remove .app bundle and plist file
|
|
30
|
+
try {
|
|
31
|
+
fs.rmSync(path.join(home, 'Applications/Greptile Fix.app'), { recursive: true, force: true })
|
|
32
|
+
} catch {}
|
|
17
33
|
try {
|
|
18
34
|
fs.unlinkSync(plistPath)
|
|
19
35
|
} catch {}
|
|
20
36
|
server.close()
|
|
37
|
+
// Remove the launchd job by label so KeepAlive won't restart us
|
|
38
|
+
try {
|
|
39
|
+
execSync('launchctl remove com.greptile.health 2>/dev/null')
|
|
40
|
+
} catch {}
|
|
21
41
|
process.exit(0)
|
|
22
42
|
}
|
|
23
43
|
}
|