File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ function readFile(path) {
18
18
return ObjC . unwrap ( str ) ;
19
19
}
20
20
21
+ const fileExists = ( /** @type {string } */ filePath ) => Application ( "Finder" ) . exists ( Path ( filePath ) ) ;
22
+
21
23
//──────────────────────────────────────────────────────────────────────────────
22
24
23
25
/** @type {Record<string, string> } */
@@ -37,6 +39,19 @@ function run() {
37
39
const home = app . pathTo ( "home folder" ) ;
38
40
const extensionPath = browserVars . extensionPath [ browser ] . replace ( / ^ ~ / , home ) ;
39
41
42
+ // GUARD browser not installed
43
+ if ( ! fileExists ( extensionPath ) ) {
44
+ return JSON . stringify ( {
45
+ items : [
46
+ {
47
+ title : browser + " not installed." ,
48
+ subtitle : "⏎: Open workflow configuration to select a different browser." ,
49
+ arg : `alfredpreferences://navigateto/workflows>workflow>${ $ . getenv ( "alfred_workflow_uid" ) } >userconfig>browser` ,
50
+ } ,
51
+ ] ,
52
+ } ) ;
53
+ }
54
+
40
55
// SETTINGS
41
56
const settings = JSON . parse ( readFile ( "./scripts/all-chromium-browser-settings.json" ) ) ;
42
57
settings . push ( ...browserVars . settingsPages [ browser ] ) ;
You can’t perform that action at this time.
0 commit comments