diff options
Diffstat (limited to 'link/icloud.sh')
| -rwxr-xr-x | link/icloud.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/link/icloud.sh b/link/icloud.sh new file mode 100755 index 0000000..6daa287 --- /dev/null +++ b/link/icloud.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Short names for iCloud Drive, on a Mac signed into it. Dry run by default; +# pass `yes` to apply. + +set -euo pipefail + +# shellcheck source-path=SCRIPTDIR +# shellcheck source=lib.sh +source "$(dirname "$0")/lib.sh" "$@" + +# ~/.icloud is iCloud Drive itself and ~/.cloud its dotfiles folder, which holds +# what cannot go in a repo. ~/.cloud is load-bearing: hammerspoon reads its text +# snippets from ~/.cloud/shorts. +# +# These used to be made by ~/.cloud/link.sh, along with ~/.keys and ~/.ssh as +# links into iCloud. Those two are gone for good: ~/.ssh is a real local +# directory, and the one key still kept in iCloud is linked by a private layer. +if [[ -d "$icloud_dir" ]] +then + link "$icloud_dir" "$HOME/.icloud" + link "$icloud_dir/dotfiles" "$HOME/.cloud" +fi |
