git-multirepo 1.0.0.beta12 → 1.0.0.beta15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commands.rb +1 -0
- data/lib/info.rb +1 -1
- data/lib/multirepo/commands/add-command.rb +1 -1
- data/lib/multirepo/commands/branch-command.rb +1 -1
- data/lib/multirepo/commands/checkout-command.rb +1 -1
- data/lib/multirepo/commands/clone-command.rb +54 -0
- data/lib/multirepo/commands/command.rb +0 -4
- data/lib/multirepo/commands/edit-command.rb +1 -1
- data/lib/multirepo/commands/fetch-command.rb +1 -1
- data/lib/multirepo/commands/init-command.rb +1 -1
- data/lib/multirepo/commands/install-command.rb +10 -6
- data/lib/multirepo/commands/open-command.rb +1 -1
- data/lib/multirepo/commands/uninit-command.rb +1 -1
- data/lib/multirepo/commands/update-command.rb +1 -1
- data/lib/multirepo/utility/runner.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e82b1d4dc7e0ce39b4b686b972ca4d71668129b
|
4
|
+
data.tar.gz: 0d7ea7821b543a7378d387105b694106683bcd45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b96fd301dcf1160ce12f981a056f3a369972af9a1bf14741fc00bfed880f2ca2babbcc42a255bdfdb9416697b81cc069a5885fbbbf2870b8132ceae659c238a
|
7
|
+
data.tar.gz: e190376df8033efb5ebd67f302a0ea1243cbd30159c936969c25097db3406503411d5de24d90ffeac858791a5b16247103a45d45139942a2aedc479be2542064
|
data/lib/commands.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative "multirepo/commands/command"
|
|
2
2
|
require_relative "multirepo/commands/add-command"
|
3
3
|
require_relative "multirepo/commands/branch-command"
|
4
4
|
require_relative "multirepo/commands/checkout-command"
|
5
|
+
require_relative "multirepo/commands/clone-command"
|
5
6
|
require_relative "multirepo/commands/edit-command"
|
6
7
|
require_relative "multirepo/commands/fetch-command"
|
7
8
|
require_relative "multirepo/commands/init-command"
|
data/lib/info.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
require "multirepo/utility/console"
|
2
|
+
require "multirepo/utility/utils"
|
3
|
+
require "multirepo/git/repo"
|
4
|
+
require_relative "install-command"
|
5
|
+
|
6
|
+
module MultiRepo
|
7
|
+
class CloneCommand < Command
|
8
|
+
self.command = "clone"
|
9
|
+
self.summary = "Clones the specified repository in a subfolder, then installs it."
|
10
|
+
|
11
|
+
def self.options
|
12
|
+
[
|
13
|
+
['[url]', 'The repository to clone.'],
|
14
|
+
['[name]', 'The name of the containing folder that will be created.']
|
15
|
+
].concat(super)
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(argv)
|
19
|
+
@url = argv.shift_argument
|
20
|
+
@name = argv.shift_argument
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
24
|
+
def validate!
|
25
|
+
super
|
26
|
+
help! "You must specify a repository to clone" unless @url
|
27
|
+
help! "You must specify a containing folder name" unless @name
|
28
|
+
end
|
29
|
+
|
30
|
+
def run
|
31
|
+
Console.log_step("Cloning #{@url} ...")
|
32
|
+
|
33
|
+
raise MultiRepoException, "A directory named #{@name} already exists" if Dir.exists?(@name)
|
34
|
+
|
35
|
+
main_repo_path = "#{@name}/#{@name}"
|
36
|
+
|
37
|
+
FileUtils.mkpath(main_repo_path)
|
38
|
+
|
39
|
+
main_repo = Repo.new(main_repo_path)
|
40
|
+
main_repo.clone(@url)
|
41
|
+
|
42
|
+
original_path = Dir.pwd
|
43
|
+
Dir.chdir(main_repo_path)
|
44
|
+
|
45
|
+
InstallCommand.new(CLAide::ARGV.new([])).install_internal
|
46
|
+
|
47
|
+
Dir.chdir(original_path)
|
48
|
+
|
49
|
+
Console.log_step("Done!")
|
50
|
+
rescue MultiRepoException => e
|
51
|
+
Console.log_error(e.message)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -8,22 +8,26 @@ module MultiRepo
|
|
8
8
|
self.summary = "Clones and checks out dependencies as defined in the .multirepo file, and installs git-multirepo's local pre-commit hook."
|
9
9
|
|
10
10
|
def run
|
11
|
-
|
11
|
+
validate_in_work_tree
|
12
12
|
ensure_multirepo_initialized
|
13
13
|
|
14
14
|
Console.log_step("Cloning dependencies and installing hook...")
|
15
15
|
|
16
|
+
install_internal
|
17
|
+
|
18
|
+
Console.log_step("Done!")
|
19
|
+
rescue MultiRepoException => e
|
20
|
+
Console.log_error(e.message)
|
21
|
+
end
|
22
|
+
|
23
|
+
def install_internal
|
16
24
|
config_entries = ConfigFile.load
|
17
25
|
|
18
|
-
Console.
|
26
|
+
Console.log_substep("Installing #{config_entries.count} dependencies...");
|
19
27
|
|
20
28
|
config_entries.each { |e| install(e) }
|
21
29
|
|
22
30
|
self.install_pre_commit_hook
|
23
|
-
|
24
|
-
Console.log_step("Done!")
|
25
|
-
rescue MultiRepoException => e
|
26
|
-
Console.log_error(e.message)
|
27
31
|
end
|
28
32
|
|
29
33
|
def install(entry)
|
@@ -17,7 +17,7 @@ module MultiRepo
|
|
17
17
|
lines = []
|
18
18
|
Open3.popen2e(cmd) do |stdin, stdout_and_stderr, thread|
|
19
19
|
stdout_and_stderr.each do |line|
|
20
|
-
Console.log_info(line) if verbosity == Verbosity::ALWAYS_OUTPUT || Config.instance.verbose
|
20
|
+
Console.log_info(line.rstrip) if verbosity == Verbosity::ALWAYS_OUTPUT || Config.instance.verbose
|
21
21
|
lines << line
|
22
22
|
end
|
23
23
|
@last_command_succeeded = thread.value.success?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-multirepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michaël Fortin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/multirepo/commands/add-command.rb
|
127
127
|
- lib/multirepo/commands/branch-command.rb
|
128
128
|
- lib/multirepo/commands/checkout-command.rb
|
129
|
+
- lib/multirepo/commands/clone-command.rb
|
129
130
|
- lib/multirepo/commands/command.rb
|
130
131
|
- lib/multirepo/commands/edit-command.rb
|
131
132
|
- lib/multirepo/commands/fetch-command.rb
|