danger-swiftlint 0.28.0 → 0.29.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed42295ae38914afa20f0e0cb218bab68041937b967bdeac37a44d68b020d062
4
- data.tar.gz: 8d4df36e091935dc287809571ce41317ae155bfebff4ffe2d6432b9c6b637bc6
3
+ metadata.gz: ff4ffa2a084c5b903a14711210a95e1bdfe5044d85c3bbff488d5c092c9de9d5
4
+ data.tar.gz: 4a8252e860e488785d35b9283de12873a444f59f6be9ce26510c6bdcc29ad09b
5
5
  SHA512:
6
- metadata.gz: 29d8b6d7f3091dc5019148a2342575ab00ebc7160cab39c91205b26daeeba08c2d44015a87eb2a6758989e4b4520d2411b2bdbd0259211e36d1cebe08f0a71eb
7
- data.tar.gz: 501f8cf1841ce33ae57dedbe1b3bc5c2723ecde16a7398893c67e3e0a3731da31aa54acea6f9491f42f9985c40ff19856465eaf93744e08447c4a57f27cee56c
6
+ metadata.gz: 159d9e9f5b4080cc3ed71affa8da60f9e74147c34befb33a75005e9013dc6d26082612251f2c24611dc57bd7f6aa49b7eebcb22bf96ee14e461e1eaf034f98ab
7
+ data.tar.gz: 904d07909f3d8720a2ce1f6a774b64f716b6b0b58a373b0e23fbe6c3dba2a132f3b39414b86946efae6746c60c9295ff3498d40571532f7b5a8208aafa70b631
@@ -12,14 +12,11 @@ namespace :swiftlint do
12
12
  ASSET = 'portable_swiftlint.zip'
13
13
  URL = "#{REPO}/releases/download/#{VERSION}/#{ASSET}"
14
14
  DESTINATION = File.expand_path(File.join(File.dirname(__FILE__), 'bin'))
15
+ SCRIPT_PATH = File.expand_path(File.join(File.dirname(__FILE__)))
16
+ SWIFTLINT_MD5_HASH = DangerSwiftlint::SWIFTLINT_HASH
15
17
 
16
18
  puts "Downloading swiftlint@#{VERSION}"
17
- sh [
18
- "mkdir -p '#{DESTINATION}'",
19
- "curl -s -L #{URL} -o #{ASSET}",
20
- "unzip -q #{ASSET} -d '#{DESTINATION}'",
21
- "rm #{ASSET}"
22
- ].join(' && ')
19
+ sh "sh #{SCRIPT_PATH}/downloadSwiftlint.sh -u #{URL} -d #{DESTINATION} -a #{ASSET} -dh #{SWIFTLINT_MD5_HASH}"
23
20
  end
24
21
  end
25
22
 
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ### Load arguments
4
+ while [[ $# > 0 ]]
5
+ do
6
+ case "$1" in
7
+ -u|--url)
8
+ url="$2"
9
+ shift;;
10
+
11
+ -d|--destination)
12
+ destination="$2"
13
+ shift;;
14
+
15
+ -a|--asset)
16
+ asset="$2"
17
+ shift;;
18
+
19
+ -dh|--default_hash)
20
+ default_hash="$2"
21
+ shift;;
22
+
23
+ --help|*)
24
+ echo "Usage:"
25
+ echo ' -u --url: URL for SwiftLint version to download'
26
+ echo ' -d --destination: Folder where SwiftLint will be downloaded'
27
+ echo " -a --asset: Temporary name for the zip file"
28
+ echo " -dh --default_hash: Default SwiftLint md5 hash to check for if no version specified"
29
+ exit 1;;
30
+ esac
31
+ shift
32
+ done
33
+
34
+ ### Download
35
+ mkdir -p "${destination}"
36
+ curl -s -L "${url}" -o "${asset}"
37
+ if [[ ! -z "${SWIFTLINT_VERSION}" || $(md5 -q "${asset}") == "${default_hash}" ]]; then
38
+ # if another version is set || our hardcoded hash is correct
39
+ unzip -o -q "${asset}" -d "${destination}"
40
+ else
41
+ echo "Zip was corrupted, try again later."
42
+ fi
43
+ rm "${asset}"
data/lib/version.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DangerSwiftlint
4
- VERSION = '0.28.0'
4
+ VERSION = '0.29.3'
5
5
  SWIFTLINT_VERSION = '0.43.1'
6
+ SWIFTLINT_HASH = '4eaeabbb43b308975d16e3d9869880dc'
6
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-swiftlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash Furrow
@@ -155,6 +155,7 @@ extra_rdoc_files: []
155
155
  files:
156
156
  - bin/danger-swiftlint
157
157
  - ext/swiftlint/Rakefile
158
+ - ext/swiftlint/downloadSwiftlint.sh
158
159
  - ext/swiftlint/swiftlint.rb
159
160
  - lib/danger_plugin.rb
160
161
  - lib/version.rb