create-discourse-plugin 0.1.0 → 0.3.0
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/create-discourse-plugin.rb +36 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c6e3bf27a2b800b349c8f30b2e8b8e81fc24220851e36a5bd1c87dab33b315e
|
4
|
+
data.tar.gz: 5ec9e8a268ca19ecaae431a324d4d948dbdb356abf4e40a8c81d4debc327d75e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 067110feec13eabe2acfb9dd43aacbb1f57d25abcb5bdaab62bc42e61a244905a4b498a68cc391e638379eaecb8e8c31e0d1cc60f76453ce7d3409cd30cd0580
|
7
|
+
data.tar.gz: cb3558b733dcad69d3886ec4d1646bf690f165dcec936ead991921815de053f63da226a44bc5cd5792bf14fdb908bb7cca169997d7e4553901c8e346ba5439c5
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
1
3
|
# Helper
|
2
4
|
class Helpers
|
3
5
|
def self.to_snake_case(string)
|
@@ -20,7 +22,40 @@ if plugin_name.nil?
|
|
20
22
|
plugin_name = gets.chomp
|
21
23
|
end
|
22
24
|
|
23
|
-
|
25
|
+
parser = OptionParser.new
|
26
|
+
|
27
|
+
visibility = 'private'
|
28
|
+
parser.on('-p [p]', '--public', 'Create the plugin in a public repo') do
|
29
|
+
visibility = 'public'
|
30
|
+
end
|
31
|
+
|
32
|
+
parser.on('--private [private]', 'Create the plugin in a private repo, this is default') do
|
33
|
+
visibility = 'private'
|
34
|
+
end
|
35
|
+
|
36
|
+
repo_name = plugin_name
|
37
|
+
parser.on('-o [o]', '--organization', 'Create the plugin in a private repo under an organization') do |organization|
|
38
|
+
repo_name = "#{organization}/#{plugin_name}"
|
39
|
+
end
|
40
|
+
|
41
|
+
parser.on('-h [h]', '--help', 'Display this help message') do
|
42
|
+
puts parser
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
|
46
|
+
parser.parse!
|
47
|
+
|
48
|
+
if repo_name == plugin_name
|
49
|
+
puts 'do you want to add an org? [y/n], default is n'
|
50
|
+
org = gets.chomp
|
51
|
+
if org == 'y'
|
52
|
+
puts 'Enter the organization name:'
|
53
|
+
org_name = gets.chomp
|
54
|
+
repo_name = "#{org_name}/#{plugin_name}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
system "gh repo create #{repo_name} --template discourse/discourse-plugin-skeleton --#{visibility} --clone"
|
24
59
|
|
25
60
|
puts '🚂 Renaming directories...'
|
26
61
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: create-discourse-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Grubba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Based on the Discourse plugin skeleton, this script creates a new plugin
|
14
14
|
with the provided name.
|