discourse_cli_tool 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/lib/discourse_cli/commands/topics.rb +3 -9
- data/lib/discourse_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: 2f85a2451232e1d21e616d56497f3a2eefcd7875525278e61821454ef72069d3
|
|
4
|
+
data.tar.gz: 4849b6f1dfa072a46ff7855fd9bf637d6e28000324cc85aa737f852203fad5f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41e07d72153230d31b6572e2392e747dc076d9accba1d4b37abadb1a14422d95a0df2e4d599a631be472195fa6772ec952898523eec08d03ffd597387a0896f6
|
|
7
|
+
data.tar.gz: ee479f290a32beb230091d6647e40d540f5897b7db39ccb9f0bcba03c708d04c6a7cb7c61bfcad984d325ae79d3447c43a19137b5da9f7c2e2832c26976f6c5d
|
|
@@ -22,7 +22,7 @@ module DiscourseCli
|
|
|
22
22
|
|
|
23
23
|
desc "create", "Create a topic (opens $EDITOR if --raw not given)"
|
|
24
24
|
option :title, type: :string, required: true
|
|
25
|
-
option :category, type: :
|
|
25
|
+
option :category, type: :numeric, desc: "Category ID"
|
|
26
26
|
option :tags, type: :string, desc: "Comma-separated tags"
|
|
27
27
|
option :raw, type: :string
|
|
28
28
|
def create
|
|
@@ -37,7 +37,7 @@ module DiscourseCli
|
|
|
37
37
|
|
|
38
38
|
desc "update ID", "Update a topic"
|
|
39
39
|
option :title, type: :string
|
|
40
|
-
option :category, type: :
|
|
40
|
+
option :category, type: :numeric, desc: "Category ID"
|
|
41
41
|
option :raw, type: :string, desc: "Replace first post content (opens $EDITOR if not given and no other options)"
|
|
42
42
|
def update(id)
|
|
43
43
|
updated_anything = false
|
|
@@ -48,13 +48,7 @@ module DiscourseCli
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
if options[:category]
|
|
51
|
-
|
|
52
|
-
cat = cats.find { |c| c["slug"] == options[:category] || c["name"] == options[:category] }
|
|
53
|
-
unless cat
|
|
54
|
-
$stderr.puts "Category not found: #{options[:category]}"
|
|
55
|
-
exit 1
|
|
56
|
-
end
|
|
57
|
-
client.recategorize_topic(id.to_i, cat["id"])
|
|
51
|
+
client.recategorize_topic(id.to_i, options[:category])
|
|
58
52
|
updated_anything = true
|
|
59
53
|
end
|
|
60
54
|
|