pagiii 0.1.3 → 0.1.4
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 +4 -4
- data/bin/pagiii +5 -10
- data/lib/pagiii/theme_sync.rb +2 -2
- 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: f411cb7c273f1b38e4bc59325c7b8d9042da6b7ce9a45abefcf91e1e475b9276
|
|
4
|
+
data.tar.gz: 5e1562b9c696200a58cdaa99defa596635d909b1281e28ccf082b0ceae2c7968
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c0b536ef4c9fbb5ac10ccaeb4a8d0adfb7e395449e08e512b9b2d45b044884098fd3e4eb1f15f1cd92182a4ea7355e5fb3f7c79f2ff6f174880ffa5180ceaea
|
|
7
|
+
data.tar.gz: 3584c4bf74c587d7e260e77e4c17fbab05701cc87568302fd9ddb29dcd45b8753428c6cf287d30857abe283f4a157bb6130b12f6ec8e5e53ed9ad6ed96f48214
|
data/bin/pagiii
CHANGED
|
@@ -14,12 +14,7 @@ def root_api
|
|
|
14
14
|
"https://pagiii.com"
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
secret_id = 'WlENailhg7KEbZqXXwX4Y470HYGL8-U2af_bOZGVWeQ'
|
|
19
|
-
redirect_uri = 'http://localhost:7654'
|
|
20
|
-
scope = 'read_theme write_theme delete_theme'
|
|
21
|
-
|
|
22
|
-
program :version, '0.1.3'
|
|
17
|
+
program :version, '0.1.4'
|
|
23
18
|
program :description, 'Pagiii CLI'
|
|
24
19
|
|
|
25
20
|
|
|
@@ -51,10 +46,10 @@ end
|
|
|
51
46
|
|
|
52
47
|
def update_config(email, password)
|
|
53
48
|
dir = "#{Dir.home}/.pagiii"
|
|
54
|
-
FileUtils.mkdir_p(dir) unless Dir.
|
|
49
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
|
55
50
|
file = File.join(dir, 'config.json')
|
|
56
51
|
hash = {}
|
|
57
|
-
if File.
|
|
52
|
+
if File.exist?(file)
|
|
58
53
|
hash = JSON.parse(IO.read(file))
|
|
59
54
|
end
|
|
60
55
|
hash[:email] = email
|
|
@@ -67,9 +62,9 @@ end
|
|
|
67
62
|
|
|
68
63
|
def read_config
|
|
69
64
|
dir = "#{Dir.home}/.pagiii"
|
|
70
|
-
return nil unless Dir.
|
|
65
|
+
return nil unless Dir.exist?(dir)
|
|
71
66
|
file = File.join(dir, 'config.json')
|
|
72
|
-
return nil unless File.
|
|
67
|
+
return nil unless File.exist?(file)
|
|
73
68
|
hash = JSON.parse(IO.read(file))
|
|
74
69
|
hash
|
|
75
70
|
end
|
data/lib/pagiii/theme_sync.rb
CHANGED
|
@@ -224,7 +224,7 @@ class Pagiii::ThemeSync
|
|
|
224
224
|
say "downloading #{asset['asset_key']}"
|
|
225
225
|
response = download_asset(site: site, theme_id: parsed_response['theme']['id'], key: asset['asset_key'])
|
|
226
226
|
path = File.split(asset['asset_key'])
|
|
227
|
-
FileUtils.mkdir(path.first) unless Dir.
|
|
227
|
+
FileUtils.mkdir(path.first) unless Dir.exist?(path.first)
|
|
228
228
|
File.open(asset['asset_key'], 'wb') do |f|
|
|
229
229
|
f.write(response.body)
|
|
230
230
|
end
|
|
@@ -302,4 +302,4 @@ class Pagiii::ThemeSync
|
|
|
302
302
|
end
|
|
303
303
|
|
|
304
304
|
|
|
305
|
-
end
|
|
305
|
+
end
|