forked from ashfurrow/danger-ruby-swiftlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
23 lines (18 loc) · 738 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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'
ENV['ASSET'] = ASSET
ENV['URL'] = "#{REPO}/releases/download/#{VERSION}/#{ASSET}"
ENV['SWIFTLINT_MD5_HASH'] = DangerSwiftlint::SWIFTLINT_HASH
ENV['DESTINATION'] = File.expand_path(File.join(File.dirname(__FILE__), 'bin'))
puts "Downloading swiftlint@#{VERSION}"
sh "./downloadSwiftlint.sh"
end
end
task default: 'swiftlint:install'