update_repo 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/Rakefile +1 -1
- data/exe/update_repo +2 -2
- data/lib/update_repo.rb +7 -4
- data/lib/update_repo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 216483b2ac26f98ccf9b4b7712059f8876de2d9d
|
4
|
+
data.tar.gz: 5fd33a763737cfb1ad7410bf7703b7650e27ddd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4698880b1584aeab7f6f7fd9400fdfe41953cfa1446a2bafcd70f912b73d66dc5ba598fd1671770a509614ed26b794b12300107ed369a10ac36e7546a1d518
|
7
|
+
data.tar.gz: 03fadd911508d1b51dbd3ffa5b8adf5fd6b3bd25d6fc1309c7d69ff55d2105d536d4df6ec636440cd4a74b9f8bc1ac6309f6d627baf7f646dda470094ae9b4ff
|
data/README.md
CHANGED
@@ -41,7 +41,15 @@ $ update_repo
|
|
41
41
|
To be added.
|
42
42
|
|
43
43
|
#### Command line switches
|
44
|
-
|
44
|
+
Options are not required. If none are specified then the program will read from the standard configuration file (~/.updaterepo) and automatically update the specified Repositories.
|
45
|
+
|
46
|
+
Enter `update_repo --help` at the command prompt to get a list of available options :
|
47
|
+
```
|
48
|
+
Options:
|
49
|
+
-c, --color, --no-color Use colored output (default: true)
|
50
|
+
-v, --version Print version and exit
|
51
|
+
-h, --help Show this message
|
52
|
+
```
|
45
53
|
|
46
54
|
## To-Do
|
47
55
|
Not in any specific order :
|
@@ -60,7 +68,6 @@ Not in any specific order :
|
|
60
68
|
- Add new repo from the command line that will be cloned to the default repo directory and then updated as usual. Extra flag added for "add only, clone later" for offline use.
|
61
69
|
- Add flag for 'default' repo directory (or another specific directory - if it does not already exist it will be created and added to the standard list) which will be used for new additions.
|
62
70
|
- Option to save log file for each run.
|
63
|
-
- Option to disable the coloured output
|
64
71
|
- Add option to only display a (text) tree of the discovered git repositories, not updating them; Similar option to just dump a list of the remote git locations.
|
65
72
|
- Add ability to export a text dump of each repo location and then re-import this on a different machine or after reinstall
|
66
73
|
- Document configuration file format and options.
|
data/Rakefile
CHANGED
data/exe/update_repo
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
require 'update_repo'
|
3
3
|
|
4
4
|
# Catch ctrl-c and abort gracefully without Ruby back trace...
|
5
|
-
Signal.trap('INT')
|
5
|
+
Signal.trap('INT') do
|
6
6
|
print "\r -> ".red, "Aborting on user request.\n\n"
|
7
7
|
exit
|
8
|
-
|
8
|
+
end
|
9
9
|
|
10
10
|
# create a new instance of the class...
|
11
11
|
walk_repo = UpdateRepo::WalkRepo.new
|
data/lib/update_repo.rb
CHANGED
@@ -12,6 +12,7 @@ module UpdateRepo
|
|
12
12
|
|
13
13
|
# An encapsulated class to walk the repo directories and update all Git
|
14
14
|
# repositories found therein.
|
15
|
+
# rubocop:disable Metrics/ClassLength
|
15
16
|
class WalkRepo
|
16
17
|
# Class constructor. No parameters required.
|
17
18
|
# @return [void]
|
@@ -42,6 +43,7 @@ module UpdateRepo
|
|
42
43
|
# walk_repo = UpdateRepo::WalkRepo.new
|
43
44
|
# walk_repo.start
|
44
45
|
def start
|
46
|
+
String.disable_colorization = true unless @config['cmd'][:color]
|
45
47
|
show_header(@config['exceptions'])
|
46
48
|
@config['location'].each do |loc|
|
47
49
|
recurse_dir(loc)
|
@@ -60,11 +62,12 @@ module UpdateRepo
|
|
60
62
|
exit 1
|
61
63
|
end
|
62
64
|
|
63
|
-
# rubocop:disable Metrics
|
65
|
+
# rubocop:disable Metrics/MethodLength
|
64
66
|
def set_options
|
65
67
|
Trollop.options do
|
66
|
-
version "
|
68
|
+
version "update_repo version #{VERSION} (C)2016 G. Ramsay\n"
|
67
69
|
banner <<-EOS
|
70
|
+
|
68
71
|
Keep multiple local Git-Cloned Repositories up to date with one command.
|
69
72
|
|
70
73
|
Usage:
|
@@ -76,13 +79,13 @@ specified Repositories.
|
|
76
79
|
|
77
80
|
Options:
|
78
81
|
EOS
|
79
|
-
|
82
|
+
opt :color, 'Use colored output', default: true
|
80
83
|
# opt :quiet, 'Only minimal output to the terminal', default: false
|
81
84
|
# opt :silent, 'Completely silent, no output to terminal at all.',
|
82
85
|
# default: false
|
83
86
|
end
|
84
87
|
end
|
85
|
-
# rubocop:enable Metrics
|
88
|
+
# rubocop:enable Metrics/MethodLength
|
86
89
|
|
87
90
|
# take each directory contained in the Repo directory, if it is detected as
|
88
91
|
# a Git repository then update it (or as directed by command line)
|
data/lib/update_repo/version.rb
CHANGED