pagecord-cli 0.2.0 → 0.2.1
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/README.md +7 -5
- data/lib/pagecord_cli/cli.rb +6 -11
- data/lib/pagecord_cli/version.rb +1 -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: 5e79c8864b73579755f1699da00835d474cae8871b64c5ff21e091d4540e95be
|
|
4
|
+
data.tar.gz: bbdc8963f7317ec56f55de326898021d1bf5712f15c8833c83f6ccbac533f06f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b6dab32f1f4884be02388a220d441fbe21041940d5f3c4a6e607ce4c9ff4c60d12582ae9f60435cbcf87b3e3645f9fd58cc144a55b4b453bd2a9f628cde3c0a3
|
|
7
|
+
data.tar.gz: 208af262450558105da20a6006cf70340e804ad6c4fadf4dbab05aada82a572efd0f5af01cfd12cdec2d1b20511473407d00d5f87c51d1ae36e6b45bebbde3ef
|
data/README.md
CHANGED
|
@@ -88,17 +88,19 @@ Fields: `--theme`, `--font`, `--width`, `--layout`, the six
|
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
pagecord custom-code show --css > blog.css
|
|
91
|
-
pagecord custom-code update --css
|
|
91
|
+
pagecord custom-code update --css blog.css
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
file, or as `@-` to read standard input:
|
|
94
|
+
`--css`, `--footer-html`, `--head-html` and `--body-html` each take the path to
|
|
95
|
+
a file holding that content, so you can keep all of it under version control:
|
|
97
96
|
|
|
98
97
|
```bash
|
|
99
|
-
|
|
98
|
+
pagecord custom-code update --css blog.css --footer-html footer.html
|
|
100
99
|
```
|
|
101
100
|
|
|
101
|
+
There is also `--enabled true|false` to switch your head and body code off
|
|
102
|
+
without deleting it.
|
|
103
|
+
|
|
102
104
|
`custom-code show` prints JSON, or the raw field when you name one, so
|
|
103
105
|
redirecting it to a file round-trips.
|
|
104
106
|
|
data/lib/pagecord_cli/cli.rb
CHANGED
|
@@ -184,7 +184,7 @@ module PagecordCLI
|
|
|
184
184
|
params = {}
|
|
185
185
|
parser do |opts|
|
|
186
186
|
CUSTOM_CODE_FIELDS.each do |flag, name|
|
|
187
|
-
opts.on("--#{flag}
|
|
187
|
+
opts.on("--#{flag} PATH") { |path| params[name] = read_file(flag, path) }
|
|
188
188
|
end
|
|
189
189
|
opts.on("--enabled BOOL", TrueClass) { |value| params["custom_code_enabled"] = value }
|
|
190
190
|
end.parse!(argv)
|
|
@@ -266,14 +266,10 @@ module PagecordCLI
|
|
|
266
266
|
)
|
|
267
267
|
end
|
|
268
268
|
|
|
269
|
-
def
|
|
270
|
-
|
|
271
|
-
when "@-" then input.read
|
|
272
|
-
when /\A@/ then File.read(value[1..])
|
|
273
|
-
else value
|
|
274
|
-
end
|
|
269
|
+
def read_file(flag, path)
|
|
270
|
+
File.read(path)
|
|
275
271
|
rescue SystemCallError
|
|
276
|
-
raise Error, "Could not read #{
|
|
272
|
+
raise Error, path.match?(/[{<]/) ? "--#{flag} takes a file path, not the content itself" : "Could not read #{path}"
|
|
277
273
|
end
|
|
278
274
|
|
|
279
275
|
def say(message)
|
|
@@ -314,6 +310,7 @@ module PagecordCLI
|
|
|
314
310
|
pagecord appearance show
|
|
315
311
|
pagecord appearance update [options]
|
|
316
312
|
pagecord custom-code show [--css|--footer-html|--head-html|--body-html]
|
|
313
|
+
pagecord custom-code update --css blog.css
|
|
317
314
|
pagecord custom-code update [options]
|
|
318
315
|
pagecord publish FILE [SUBDOMAIN] [options]
|
|
319
316
|
pagecord draft FILE [SUBDOMAIN] [options]
|
|
@@ -339,10 +336,8 @@ module PagecordCLI
|
|
|
339
336
|
--show-branding true|false
|
|
340
337
|
|
|
341
338
|
Custom code options:
|
|
342
|
-
--css, --footer-html, --head-html, --body-html
|
|
339
|
+
--css, --footer-html, --head-html, --body-html (each takes a file path)
|
|
343
340
|
--enabled true|false
|
|
344
|
-
|
|
345
|
-
Custom code values can be a literal, @path to read a file, or @- to read stdin.
|
|
346
341
|
HELP
|
|
347
342
|
0
|
|
348
343
|
end
|
data/lib/pagecord_cli/version.rb
CHANGED