smdev 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smdev.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6756e94f34ed4d1ec94eba484d664034bb59a90a508d36b1261c5744c8d9082f
|
4
|
+
data.tar.gz: 4b3c3a8f3478d71247c90a38226d9cd263fd47aba6ccebaa76a8d86a1e0dd502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77a5e17d8b7e23241c4f3645894e6ab86b498f50b919e9b1b367c70b0f9d5644199ed45440741f1f19b4d5d1163571efa222d83ace85be8faf498b74cd69d6a
|
7
|
+
data.tar.gz: 73d4de11312a3cae6ab6d7d4a1e80bad8e22cda5ec2f2604e772f14e4d505a3c39cc0cea17a6add21ba1241cbeff05c9af41bdfa025d119d1d72b11b3c7fef7f
|
data/lib/smdev.rb
CHANGED
@@ -200,7 +200,15 @@ module Smdev
|
|
200
200
|
|
201
201
|
if Dir.exist?(repo_name)
|
202
202
|
puts "Checking for updates to '#{repo_name}'"
|
203
|
-
|
203
|
+
if options[:https]
|
204
|
+
puts "Using HTTPS to pull repo"
|
205
|
+
token = ENV['GITHUB_TOKEN']
|
206
|
+
url_with_token = url.sub('https://', "https://#{token}@")
|
207
|
+
`cd #{repo_name} && git -c http.extraHeader="Authorization: Bearer #{token}" pull #{url_with_token}`
|
208
|
+
else
|
209
|
+
puts "Using SSH to pull repo"
|
210
|
+
`cd #{repo_name} && git pull`
|
211
|
+
end
|
204
212
|
else
|
205
213
|
puts "Repository '#{repo_name}' isn't cloned locally. Skipping update."
|
206
214
|
end
|