all repos — dot @ master

Shell, editor and terminal configuration, and the tools that go with them

link/icloud.sh (view raw)

 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

# 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