@@ -68,16 +68,7 @@ func ActivateIINA() error {
6868}
6969
7070func resolveIINABin (configured string ) (string , error ) {
71- candidates := []string {}
72- if strings .TrimSpace (configured ) != "" {
73- candidates = append (candidates , strings .TrimSpace (configured ))
74- }
75- candidates = append (candidates ,
76- "/Users/nuc/.local/bin/iina-cli" ,
77- "/Applications/IINA.app/Contents/MacOS/iina-cli" ,
78- "iina-cli" ,
79- "iina" ,
80- )
71+ candidates := iinaBinCandidates (configured )
8172 for _ , candidate := range candidates {
8273 if candidate == "" {
8374 continue
@@ -95,6 +86,22 @@ func resolveIINABin(configured string) (string, error) {
9586 return "" , fmt .Errorf ("iina executable not found" )
9687}
9788
89+ func iinaBinCandidates (configured string ) []string {
90+ candidates := []string {}
91+ if strings .TrimSpace (configured ) != "" {
92+ candidates = append (candidates , strings .TrimSpace (configured ))
93+ }
94+ if home , err := os .UserHomeDir (); err == nil && strings .TrimSpace (home ) != "" {
95+ candidates = append (candidates , filepath .Join (home , ".local" , "bin" , "iina-cli" ))
96+ }
97+ candidates = append (candidates ,
98+ "/Applications/IINA.app/Contents/MacOS/iina-cli" ,
99+ "iina-cli" ,
100+ "iina" ,
101+ )
102+ return candidates
103+ }
104+
98105func WaitForFirstSample (ctx context.Context , socketPath string ) error {
99106 client := NewIPCClient (socketPath , 12 * time .Second )
100107 if err := client .WaitUntilReady (ctx ); err != nil {
0 commit comments