mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 01:30:25 +00:00

```bash In mysql/files/mac_shortcut.sh line 5: if [[ -e "{{ home }}/{{ user }}/Desktop/{{ app }}" ]] && [[ "${1}" -eq "remove" ]] ^------^ SC2154: remove is referenced but not assigned. In mysql/files/mac_shortcut.sh line 8: elif [[ -e "{{ dir }}/{{ app ~ '.app' if suffix else app }}" ]] && [[ "${1}" -eq "add" ]] ^---^ SC2154: add is referenced but not assigned. ```
12 lines
591 B
Bash
Executable file
12 lines
591 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
CMD='/usr/bin/osascript -e'
|
|
|
|
if [[ -e "{{ home }}/{{ user }}/Desktop/{{ app }}" ]] && [[ "${1}" == "remove" ]]
|
|
then
|
|
$CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\""
|
|
elif [[ -e "{{ dir }}/{{ app ~ '.app' if suffix else app }}" ]] && [[ "${1}" == "add" ]]
|
|
then
|
|
$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 '' }}\""
|
|
fi
|