Skip to content

Commit

Permalink
Merge pull request #3 from ilaumjd/master
Browse files Browse the repository at this point in the history
  • Loading branch information
klundberg authored Sep 21, 2024
2 parents 79f2c6e + 350e09e commit a9872b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ An asdf plugin for swiftlint (a linting and formatting tool for Swift)
In some cases, you may want fine-grained control over whether or not you use the latest version of swiftlint. New versions may introduce new opt-out rules that you're not prepared to fix yet, for instance.

If this is the case, you can use this asdf plugin to manage your swiftlint versions in the same way you would manage versions of ruby or node.js with asdf.

**Note**: This plugin is only useful on MacOS. It only downloads the prebuilt binaries provided by the swiftlint maintainers, and they only distribute MacOS binaries as of this writing.
16 changes: 15 additions & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@

set -eo pipefail

DOWNLOAD_URL="https://github.com/realm/SwiftLint/releases/download/$ASDF_INSTALL_VERSION/portable_swiftlint.zip"
# Determine OS type
case "$OSTYPE" in
darwin*)
ARCHIVE_NAME="portable_swiftlint"
;;
linux*)
ARCHIVE_NAME="swiftlint_linux"
;;
*)
echo "Unsupported OS: $OSTYPE"
exit 1
;;
esac

DOWNLOAD_URL="https://github.com/realm/SwiftLint/releases/download/$ASDF_INSTALL_VERSION/$ARCHIVE_NAME.zip"

# make a temporary download directory with a cleanup hook
readonly TMP_DOWNLOAD_DIR="$(mktemp -d -t "asdf_swiftlint_XXXXXX")"
Expand Down

0 comments on commit a9872b8

Please sign in to comment.