File tree Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -75,16 +75,6 @@ brews:
75
75
homepage : https://github.com/tearingItUp786/chatgpt-tui
76
76
commit_author :
77
77
name : tearingitup786
78
- install : |
79
- bin.install "rc-nekot" => "rc-nekot-unwrapped"
80
-
81
- (bin/"rc-nekot").write <<~EOS
82
- #!/bin/bash
83
- export NEKOT_APP_DIR={{.ProjectName}}
84
- exec "#{bin}/rc-nekot-unwrapped" "$@"
85
- EOS
86
-
87
- chmod 0755, bin/"rc-nekot"
88
78
# Setting this will prevent goreleaser to actually try to commit the updated
89
79
# formula - instead, the formula file will be stored on the dist folder only,
90
80
# leaving the responsibility of publishing it to the user.
Original file line number Diff line number Diff line change @@ -8,33 +8,32 @@ import (
8
8
"log"
9
9
"os"
10
10
"path/filepath"
11
+ "strings"
11
12
12
13
_ "github.com/mattn/go-sqlite3"
13
14
"github.com/pressly/goose/v3"
14
15
)
15
16
16
- // originally called chatgpt-tui but changed to nekot
17
17
func GetAppDirName () string {
18
- if envAppDir := os .Getenv ("NEKOT_APP_DIR" ); envAppDir != "" {
19
- return envAppDir
20
- }
21
- return ".chatgpt-tui"
18
+ exePath , err := os .Executable ()
19
+ if err != nil {
20
+ return ".chatgpt-tui" // fallback
21
+ }
22
+ binaryName := filepath .Base (exePath )
23
+ binaryName = strings .TrimSuffix (binaryName , filepath .Ext (binaryName )) // remove .exe if present
24
+
25
+ return "." + binaryName
22
26
}
23
27
24
28
func GetAppDataPath () (string , error ) {
25
- // Get the user's home directory
26
29
homeDir , err := os .UserHomeDir ()
27
30
if err != nil {
28
31
return "" , err
29
32
}
30
33
31
- // Define the application-specific part of the path
32
34
appDirName := GetAppDirName ()
33
-
34
- // Combine them to form the full path
35
35
fullPath := filepath .Join (homeDir , appDirName )
36
36
37
- // Optionally, create the directory if it doesn't already exist
38
37
err = os .MkdirAll (fullPath , 0755 )
39
38
if err != nil {
40
39
return "" , err
You can’t perform that action at this time.
0 commit comments