bard 0.37.1 → 0.38.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/bard.gemspec +1 -1
- data/bin/setup +7 -0
- data/install_files/setup +9 -4
- data/install_files/specified_bundler.rb +1 -0
- data/install_files/specified_node.rb +45 -0
- data/install_files/specified_ruby.rb +1 -0
- data/install_files/specified_yarn.rb +34 -0
- data/lib/bard.rb +3 -2
- data/lib/bard/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad6c6dd51289d7cb6595a4fe877d62be3e77060e
|
4
|
+
data.tar.gz: 210071b747c8402d99ec65645b908662513048ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a0edbbc9d106e9a68ffc7cb219fcda5e5012d35daada8532592767416ce0c77b0ba7c6bca4dae13f05d926f231c2186990a78813eaf310ab3e449e4415a343
|
7
|
+
data.tar.gz: 661c0fcc2f256135c0b3e43406d79588da0bed14a540ce1763b5ce508a795956dd53afe49ad38290f2ad7ae4b56d878a742bcc996ecba533cf66cd72e10ab0b4
|
data/bard.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables =
|
17
|
+
spec.executables = ["bard"]
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
data/bin/setup
ADDED
data/install_files/setup
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require_relative './specified_ruby'
|
3
3
|
require_relative './specified_bundler'
|
4
|
+
require_relative './specified_node'
|
5
|
+
require_relative './specified_yarn'
|
4
6
|
|
5
7
|
Dir.chdir File.expand_path("..", __dir__) do
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
exec [
|
9
|
+
SpecifiedRuby.ensure!,
|
10
|
+
SpecifiedBundler.ensure!,
|
11
|
+
SpecifiedNode.ensure!,
|
12
|
+
SpecifiedYarn.ensure!,
|
13
|
+
"bin/rake bootstrap",
|
14
|
+
].join(" && ")
|
9
15
|
end
|
10
|
-
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module SpecifiedNode
|
2
|
+
class NVMError < StandardError; end
|
3
|
+
|
4
|
+
NVM_PATH = File.expand_path("~/.nvm/nvm.sh")
|
5
|
+
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def ensure!
|
9
|
+
install_nvm unless nvm_installed?
|
10
|
+
restart unless nvm_active?
|
11
|
+
install_node unless node_installed?
|
12
|
+
"true"
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def install_nvm
|
18
|
+
system("curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash")\
|
19
|
+
or raise "Couldn't install nvm"
|
20
|
+
end
|
21
|
+
|
22
|
+
def nvm_installed?
|
23
|
+
File.exist?(NVM_PATH)
|
24
|
+
end
|
25
|
+
|
26
|
+
def install_node
|
27
|
+
nvm "install" or raise NVMError.new($?.exitstatus)
|
28
|
+
end
|
29
|
+
|
30
|
+
def node_installed?
|
31
|
+
nvm "use"
|
32
|
+
end
|
33
|
+
|
34
|
+
def restart
|
35
|
+
exec %(bash -lc ". #{NVM_PATH}; #{$0}")
|
36
|
+
end
|
37
|
+
|
38
|
+
def nvm_active?
|
39
|
+
ENV.key?("NVM_DIR")
|
40
|
+
end
|
41
|
+
|
42
|
+
def nvm command
|
43
|
+
system(". #{NVM_PATH}; nvm #{command}")
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module SpecifiedYarn
|
2
|
+
extend self
|
3
|
+
|
4
|
+
YARN_PATH = "node_modules/yarn/bin/yarn"
|
5
|
+
|
6
|
+
def ensure!
|
7
|
+
install_yarn unless yarn_installed?
|
8
|
+
install_binstub unless binstub_installed?
|
9
|
+
"bin/yarn install"
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def install_yarn
|
15
|
+
system(". ~/.nvm/nvm.sh && npm install yarn@#{version} --no-save")
|
16
|
+
end
|
17
|
+
|
18
|
+
def install_binstub
|
19
|
+
system("cd bin && ln -s ../#{YARN_PATH}")
|
20
|
+
end
|
21
|
+
|
22
|
+
def yarn_installed?
|
23
|
+
File.exist?(YARN_PATH) && `#{YARN_PATH} --version`.chomp == version
|
24
|
+
end
|
25
|
+
|
26
|
+
def binstub_installed?
|
27
|
+
File.exist?("bin/yarn")
|
28
|
+
end
|
29
|
+
|
30
|
+
def version
|
31
|
+
File.read("package.json")[/"yarn": "([0-9\.]+)"/, 1]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
data/lib/bard.rb
CHANGED
@@ -41,8 +41,9 @@ class Bard::CLI < Thor
|
|
41
41
|
else
|
42
42
|
run_crucial "git fetch origin master:master"
|
43
43
|
|
44
|
-
if not Git.fast_forward_merge? "master", branch
|
45
|
-
|
44
|
+
if not Git.fast_forward_merge? "origin/master", branch
|
45
|
+
puts "The master branch has advanced. Attempting rebase..."
|
46
|
+
run_crucial "git rebase origin/master"
|
46
47
|
end
|
47
48
|
|
48
49
|
run_crucial "git push -f origin #{branch}:#{branch}"
|
data/lib/bard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.38.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- Rakefile
|
183
183
|
- bard.gemspec
|
184
184
|
- bin/bard
|
185
|
+
- bin/setup
|
185
186
|
- features/bard_check.feature
|
186
187
|
- features/bard_deploy.feature
|
187
188
|
- features/bard_pull.feature
|
@@ -197,7 +198,9 @@ files:
|
|
197
198
|
- install_files/ci
|
198
199
|
- install_files/setup
|
199
200
|
- install_files/specified_bundler.rb
|
201
|
+
- install_files/specified_node.rb
|
200
202
|
- install_files/specified_ruby.rb
|
203
|
+
- install_files/specified_yarn.rb
|
201
204
|
- lib/bard.rb
|
202
205
|
- lib/bard/base.rb
|
203
206
|
- lib/bard/capistrano.rb
|
@@ -226,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
229
|
version: '0'
|
227
230
|
requirements: []
|
228
231
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
232
|
+
rubygems_version: 2.6.14
|
230
233
|
signing_key:
|
231
234
|
specification_version: 4
|
232
235
|
summary: CLI to automate common development tasks.
|