Created
August 3, 2025 04:19
-
-
Save naranyala/532f238aeb1a2ab3dbb605d7293a877c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # π§° Configuration | |
| ARCH="$(uname -m)" | |
| SWIFTLY_URL="https://download.swift.org/swiftly/linux/swiftly-${ARCH}.tar.gz" | |
| SWIFTLY_TAR="swiftly-${ARCH}.tar.gz" | |
| SWIFTLY_DIR="${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}" | |
| # π₯ Download the Swiftly archive | |
| echo "Downloading Swiftly for architecture: $ARCH" | |
| curl -fsSL -o "$SWIFTLY_TAR" "$SWIFTLY_URL" | |
| # π¦ Extract the archive | |
| echo "Extracting archive..." | |
| tar zxf "$SWIFTLY_TAR" | |
| # βοΈ Initialize Swiftly | |
| echo "Initializing Swiftly..." | |
| ./swiftly init --quiet-shell-followup | |
| # π§ͺ Load environment | |
| echo "Sourcing environment script..." | |
| if [ -f "$SWIFTLY_DIR/env.sh" ]; then | |
| . "$SWIFTLY_DIR/env.sh" | |
| else | |
| echo "β Failed to find env.sh in $SWIFTLY_DIR" | |
| exit 1 | |
| fi | |
| # π Refresh shell cache | |
| echo "Refreshing command cache..." | |
| hash -r | |
| echo "β Swiftly setup complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment