multi_repo 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e5efacc85571dad2a80c845667ec2fa40e253fd13547da6df08725d1ee18daa
4
- data.tar.gz: 9764b15530f6e62de724fa57152b6a6b3aa1af5c7bc2620a30c52de8b2314692
3
+ metadata.gz: 5f35b21a8b627819ec3d5884167260ba7d3887d3766cf5ea14d93ec717e1faaf
4
+ data.tar.gz: 1c1ba25b23f728b5284cf5947b44527482ba1bd2967a7a3d3026b7ba2c3b145e
5
5
  SHA512:
6
- metadata.gz: 45b956c9f7d52529f5c278eca077c0ce3acdbd573d80a73eac286832b8d7f99adc1efc10cee545a32decfdddb679585fac97529217104b5bb2069ee55e31dd01
7
- data.tar.gz: 66f89c406e312e39aac877141be238633535b35f2dcdf22802539c5de2433f70d46fa5e0c00ce596dd235248800a571a2a608a9b66fc03d8cb520e3232c20227
6
+ metadata.gz: 6022d318abee6743deddfdf0bd3e33a421161682c9c9f5e5bade18049e2c0982cb46651a96d05c369334ae969bb9ec17dd4eeba776bea36e48964d9f5dc19d34
7
+ data.tar.gz: 21ce3ed99d97f4fc2538e9e31ea610ff65420fe2937ed77c3418bceaac63def8033e5104b7232612459a89a6f2099554a89cf09c5189ac2f2372d725c5c48056
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /config/
3
3
  /mirrors/
4
+ /pkg/
4
5
  /repos/
5
6
  /spec/root/
6
7
  Gemfile.lock
data/exe/multi_repo CHANGED
@@ -1,29 +1,32 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env ruby
2
2
 
3
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/null && pwd)/scripts"
3
+ SCRIPT_DIR = File.expand_path("../scripts", __dir__)
4
4
 
5
- usage() {
6
- echo "Usage: multi_repo <script> [args]"
7
- echo " script Script to run"
8
- echo " args Arguments to pass to the script"
9
- echo " -h, --help Show this help message"
10
- echo
11
- echo "Available scripts:"
12
- for f in $(ls -1 "$SCRIPT_DIR" | sort); do
13
- echo " $f"
14
- done
15
- }
5
+ def usage
6
+ puts "Usage: multi_repo <script> [args]"
7
+ puts " script Script to run"
8
+ puts " args Arguments to pass to the script"
9
+ puts " -h, --help Show this help message"
16
10
 
17
- if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]; then
11
+ available_scripts = Dir.children(SCRIPT_DIR).sort.map { |f| " #{f}"}
12
+ puts
13
+ puts "Available scripts:"
14
+ puts available_scripts
15
+ end
16
+
17
+ script, args = ARGV[0], ARGV[1..]
18
+
19
+ if script.nil? || script.empty? || script == "--help" || script == "-h"
18
20
  usage
19
21
  exit
20
- fi
22
+ end
21
23
 
22
- if [ ! -f "$SCRIPT_DIR/$1" ]; then
23
- echo "ERROR: script '$1' not found"
24
- echo
24
+ fq_script = File.join(SCRIPT_DIR, script)
25
+ unless File.exist?(fq_script)
26
+ puts "ERROR: script #{script.inspect} not found"
27
+ puts
25
28
  usage
26
29
  exit 1
27
- fi
30
+ end
28
31
 
29
- exec "$SCRIPT_DIR/$1" "${@:2}"
32
+ exec fq_script, *args
@@ -1,3 +1,3 @@
1
1
  module MultiRepo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors