Sha256: 12546d1e4a2bedf9fb97fc7e815c9b10d7703916e36a8f6eca949befa59b419f

Contents?: true

Size: 772 Bytes

Versions: 17

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true

require_relative '../../lib/version'

namespace :swiftlint do
  desc 'Download and install swiftlint tool'
  task :install do
    next if ENV['DANGER_SKIP_SWIFTLINT_INSTALL'] == 'YES'

    REPO = 'https://github.com/realm/SwiftLint'
    VERSION = ENV['SWIFTLINT_VERSION'] || DangerSwiftlint::SWIFTLINT_VERSION
    ASSET = 'portable_swiftlint.zip'
    URL = "#{REPO}/releases/download/#{VERSION}/#{ASSET}"
    DESTINATION = File.expand_path(File.join(File.dirname(__FILE__), 'bin'))

    puts "Downloading swiftlint@#{VERSION}"
    sh [
      "mkdir -p '#{DESTINATION}'",
      "curl -s -L #{URL} -o #{ASSET}",
      "unzip -q #{ASSET} -d '#{DESTINATION}'",
      "rm #{ASSET}"
    ].join(' && ')
  end
end

task default: 'swiftlint:install'

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
danger-swiftlint-0.28.0 ext/swiftlint/Rakefile
danger-swiftlint-0.27.0 ext/swiftlint/Rakefile
danger-swiftlint-0.26.0 ext/swiftlint/Rakefile
danger-swiftlint-0.25.0 ext/swiftlint/Rakefile
danger-swiftlint-0.24.5 ext/swiftlint/Rakefile
danger-swiftlint-0.24.4 ext/swiftlint/Rakefile
danger-swiftlint-0.24.3 ext/swiftlint/Rakefile
danger-swiftlint-0.24.2 ext/swiftlint/Rakefile
danger-swiftlint-0.24.1 ext/swiftlint/Rakefile
danger-swiftlint-0.24.0 ext/swiftlint/Rakefile
danger-swiftlint-0.23.0 ext/swiftlint/Rakefile
danger-swiftlint-0.22.0 ext/swiftlint/Rakefile
danger-swiftlint-0.21.1 ext/swiftlint/Rakefile
danger-swiftlint-0.21.0 ext/swiftlint/Rakefile
danger-swiftlint-0.20.1 ext/swiftlint/Rakefile
danger-swiftlint-0.20.0 ext/swiftlint/Rakefile
danger-swiftlint-0.19.2 ext/swiftlint/Rakefile