jekyll-ghdeploy 1.0.0 → 1.0.2
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/jekyll-ghdeploy.rb +8 -4
- data/lib/jekyll-ghdeploy/version.rb +1 -1
- data/lib/jekyll/commands/ghdeploy.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3255db3af15b988c0bb610a32296e66ed0666b2c0d0023b411b61a9ef7557e8a
|
4
|
+
data.tar.gz: eab2a20c505ce6ba65218a4e2dc23e8950d178c8ede4bceaf86e16cb3e390c93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cad223efaa4c5862fa6296cab5fc55137317724c61c8858cc68660eeee2533469b1c0e843faf307066211d89be769ac5e74eed6305640f378eee5b965d9a3e8
|
7
|
+
data.tar.gz: ad6e86ca139492e9fc102c86379f68e714ca064cadac85f5908911450be68a95d289886b89acac6d99c320cbac17e18c8ef7196cb59314f4dc6cc8701236828b
|
data/lib/jekyll-ghdeploy.rb
CHANGED
@@ -19,6 +19,8 @@ module JekyllGhDeploy
|
|
19
19
|
@branch = 'gh-pages'
|
20
20
|
@message = `git log -1 --pretty=%s`
|
21
21
|
end
|
22
|
+
|
23
|
+
@no_history = options['no_history']
|
22
24
|
end
|
23
25
|
|
24
26
|
def deploy
|
@@ -57,7 +59,7 @@ module JekyllGhDeploy
|
|
57
59
|
Dir.chdir('clone/') do
|
58
60
|
prepare_site
|
59
61
|
|
60
|
-
if !system 'cd _site; git log>/dev/null'
|
62
|
+
if !system 'cd _site; git log>/dev/null' and !@no_history
|
61
63
|
initial_commits
|
62
64
|
else
|
63
65
|
build
|
@@ -128,7 +130,7 @@ module JekyllGhDeploy
|
|
128
130
|
|
129
131
|
remote_branch = `git ls-remote --heads origin gh-pages`
|
130
132
|
|
131
|
-
if remote_branch.empty?
|
133
|
+
if remote_branch.empty? or @no_history
|
132
134
|
system 'touch .nojekyll'
|
133
135
|
else
|
134
136
|
exit unless system 'git pull --rebase origin gh-pages'
|
@@ -165,8 +167,10 @@ module JekyllGhDeploy
|
|
165
167
|
def push
|
166
168
|
puts "\n\e[1mPushing to #{@repo} #{@branch} branch\e[0m"
|
167
169
|
|
170
|
+
option = @no_history ? '-f' : ''
|
171
|
+
|
168
172
|
Dir.chdir(@dir) do
|
169
|
-
exit unless system "git push origin #{@branch}"
|
173
|
+
exit unless system "git push #{option} origin #{@branch}"
|
170
174
|
end
|
171
175
|
end
|
172
176
|
|
@@ -176,4 +180,4 @@ module JekyllGhDeploy
|
|
176
180
|
FileUtils.rm_rf('clone')
|
177
181
|
end
|
178
182
|
end
|
179
|
-
end
|
183
|
+
end
|
@@ -10,6 +10,7 @@ module Jekyll
|
|
10
10
|
|
11
11
|
c.option 'docs', '--docs', '-d', 'Built site is stored into docs directory'
|
12
12
|
c.option 'message', '--message MESSAGE', '-m MESSAGE', 'Specify a commit message'
|
13
|
+
c.option 'no_history', '--no_history', '-n', 'Built site will have no commit history'
|
13
14
|
|
14
15
|
c.action do |args, options|
|
15
16
|
Jekyll::Commands::GhDeploy.process(args, options)
|
@@ -20,7 +21,7 @@ module Jekyll
|
|
20
21
|
def process(args, options = {})
|
21
22
|
config = YAML.load_file('_config.yml')
|
22
23
|
|
23
|
-
if args.empty? && config['repository'].
|
24
|
+
if args.empty? && config['repository'].empty?
|
24
25
|
raise ArgumentError, 'You must specify a repository.'
|
25
26
|
elsif args.empty?
|
26
27
|
repo = config['repository']
|
@@ -28,6 +29,10 @@ module Jekyll
|
|
28
29
|
repo = args[0]
|
29
30
|
end
|
30
31
|
|
32
|
+
if options['no_history'] && options['docs']
|
33
|
+
raise Error, 'Options -d and -n cannot work together.'
|
34
|
+
end
|
35
|
+
|
31
36
|
site = JekyllGhDeploy::Site.new(repo, options)
|
32
37
|
|
33
38
|
at_exit do
|
@@ -35,9 +40,8 @@ module Jekyll
|
|
35
40
|
end
|
36
41
|
|
37
42
|
site.deploy
|
38
|
-
# site.build
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
42
46
|
end
|
43
|
-
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-ghdeploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Garlis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.7.
|
85
|
+
rubygems_version: 2.7.6
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Jekyll GhDeploy is a gem that helps you push your jekyll site to Github.
|