-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateworkflow
More file actions
executable file
·40 lines (36 loc) · 1.61 KB
/
createworkflow
File metadata and controls
executable file
·40 lines (36 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Argument checks
if [ $# -eq 0 ]
then
echo
echo "Please enter at least one argument -- the name of the workflow you want to create. Thanks!"
echo
exit 1
fi
if [ ! $# -eq 1 ]
then
echo
echo "Please enter only one argument -- the name of the workflow you want to create. Thanks!"
echo
exit 1
fi
# Make Directory for Workflow
mkdir -p ~/Documents/WorkflowManagement/${1}
# Setup config files for Workflow
touch ~/Documents/WorkflowManagement/${1}/default-apps.txt
touch ~/Documents/WorkflowManagement/${1}/default-url-list.txt
touch ~/Documents/WorkflowManagement/${1}/iterm-config.txt
touch ~/Documents/WorkflowManagement/${1}/init
# Setup actual Workflow Service, enabling quick switching
cp -R ~/Documents/WorkflowManagement/Setup/template.workflow ~/Documents/WorkflowManagement/${1}/${1}.workflow
sed -i '' "s/replaceName/${1}/g" ~/Documents/WorkflowManagement/${1}/${1}.workflow/Contents/Info.plist
sed -i '' "s/replaceName/${1}/g" ~/Documents/WorkflowManagement/${1}/${1}.workflow/Contents/document.wflow
open ~/Documents/WorkflowManagement/${1}/${1}.workflow
# Give Feedback
echo
echo
echo "Created workflow '${1}'! Next steps to follow:"
echo
echo " - Your customised workflow has now been created and should now be visible in the app menu under {ApplicationNameInFocus}->Services. If your device supports a touch bar, the quick actions menu under the touch bar should also contain a shortcut to the workflow!"
echo " - To set up the configuration of your workflow, navigate to ~/Documents/WorkflowManagement/${1}/ and edit the files present in that directory to configure the settings."
echo
echo