Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions packages/manual/swiftly
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

# Install Neovim `VERSION` into `PREFIX`.

# Get Helper Functions #########################################################

source "$DOTFILES/_helpers/general"

# Get System Info ##############################################################

OS=$(uname -s)
ARCH=$(uname -m)

# Prepare temporary directory ##################################################

TMP=$(mktemp -d)

cleanup() {
info "Cleaning up"
rm -rf "$TMP"
}

trap cleanup EXIT

case $OS in
Linux)

NAME=swiftly-$ARCH.tar.gz

cd "$TMP" || exit

"$DOTFILES"/scripts/download https://download.swift.org/swiftly/linux/"$NAME" "$NAME"

curl https://www.swift.org/keys/all-keys.asc | gpg --import -
curl -O https://download.swift.org/swiftly/linux/"$NAME".sig
gpg --verify "$NAME".sig "$NAME"

tar zxf "$NAME"

./swiftly init --no-modify-profile --quiet-shell-followup -y

# shellcheck disable=SC1091 # This is annoying.
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"

hash -r

;;
Darwin) ;;
*) ;;
esac
3 changes: 3 additions & 0 deletions zsh/zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ path=("$HOME/.local/bin" $path)

[[ -n $GOBIN ]] && path=("$GOBIN" $path)

[[ -f "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" ]] &&
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"

# Load mise shims early (for non-interactive & login shells).
if command -v mise &>/dev/null; then
eval "$(mise activate zsh --shims)"
Expand Down