mysql-formula/mysql/files/mac_shortcut.sh

13 lines
591 B
Bash
Raw Normal View History

2018-10-02 13:19:57 +01:00
#!/usr/bin/env bash
CMD='/usr/bin/osascript -e'
2018-10-02 20:29:24 +01:00
if [[ -e "{{ home }}/{{ user }}/Desktop/{{ app }}" ]] && [[ "${1}" == "remove" ]]
2018-10-02 13:19:57 +01:00
then
2018-10-02 20:29:24 +01:00
$CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\""
elif [[ -e "{{ dir }}/{{ app ~ '.app' if suffix else app }}" ]] && [[ "${1}" == "add" ]]
2018-10-02 13:19:57 +01:00
then
2018-10-02 20:29:24 +01:00
$CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\"" >/dev/null 2>&1
$CMD "tell application \"Finder\" to make new Alias at (path to desktop folder) to POSIX file \"{{ dir }}/{{ app }}{{ suffix or '' }}\""
2018-10-02 13:19:57 +01:00
fi