-
Notifications
You must be signed in to change notification settings - Fork 10
/
alfredenv.sh
24 lines (18 loc) · 910 Bytes
/
alfredenv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# When sourced, creates an Alfred-like environment needed by modd
# and ./bin/build (which sources the file itself)
# getvar <name> | Read a value from info.plist
getvar() {
local v="$1"
/usr/libexec/PlistBuddy -c "Print :$v" info.plist
}
# stuff in info.plist
export alfred_workflow_bundleid=$( getvar "bundleid" )
export alfred_workflow_version=$( getvar "version" )
export alfred_workflow_name=$( getvar "name" )
export INTERVAL_FIND=$( getvar "variables:INTERVAL_FIND" )
export INTERVAL_MDFIND=$( getvar "variables:INTERVAL_MDFIND" )
export INTERVAL_LOCATE=$( getvar "variables:INTERVAL_LOCATE" )
# workflow data and cache directories
export alfred_workflow_data="${HOME}/Library/Application Support/Alfred 3/Workflow Data/${alfred_workflow_bundleid}"
export alfred_workflow_cache="${HOME}/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/${alfred_workflow_bundleid}"