wslc-wip 0.1.1 → 0.1.3
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/wip/cli.rb +14 -0
- data/lib/wip/command_builder.rb +6 -4
- data/lib/wip/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 996355115196c1437d3e06148ccc257c8d39dc5c98905643b979ff032de1775c
|
|
4
|
+
data.tar.gz: c10bb414811f0e7ab33d3fcf5a80f360d8b4f61aa374120d03c394eca22b1429
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b613505166cfdc3389ab84c7bdc4c226bdbc3c1943d75b4b9c1b2a31aea9e80f5e858aa6d4e2d68028aa66686c9239d1089841dbab55534a23c5bc42768e7bba
|
|
7
|
+
data.tar.gz: 1a25e8fe70e97205d198560c48eb69cdeafc8a29716f43b2534636fb1f3fc7eb04da41907081e633eb5ec509d6e1fb383bbddae532b21324d649ee75b4b8b2b5
|
data/lib/wip/cli.rb
CHANGED
|
@@ -9,6 +9,20 @@ module Wip
|
|
|
9
9
|
class_option :config, type: :string, desc: 'Path to wip.yml'
|
|
10
10
|
default_task :dispatch
|
|
11
11
|
|
|
12
|
+
def self.exit_on_failure? = true
|
|
13
|
+
|
|
14
|
+
# Thor only falls back to the default task when no command name is given at
|
|
15
|
+
# all; an unrecognized first argument (e.g. a custom wip.yml command name)
|
|
16
|
+
# would otherwise raise "Could not find command". Route those to `dispatch`.
|
|
17
|
+
def self.dispatch(meth, given_args, given_opts, config)
|
|
18
|
+
name = given_args.first
|
|
19
|
+
if meth.nil? && name && !name.to_s.start_with?('-') && find_command_possibilities(name).empty?
|
|
20
|
+
return super('dispatch', given_args, given_opts, config)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
super
|
|
24
|
+
end
|
|
25
|
+
|
|
12
26
|
desc 'version', 'Show wip and WSLC versions'
|
|
13
27
|
def version
|
|
14
28
|
puts "wip #{VERSION}"
|
data/lib/wip/command_builder.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Wip
|
|
|
15
15
|
values = @config.defaults.merge(settings)
|
|
16
16
|
command = [@wslc, 'exec']
|
|
17
17
|
command << '-it' if tty?(interactive)
|
|
18
|
-
command.concat(options(values, include_container: true)).concat(arguments)
|
|
18
|
+
command.concat(options(values, include_container: true, include_publish: false)).concat(arguments)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def run(arguments, settings: {}, interactive: true)
|
|
@@ -46,12 +46,14 @@ module Wip
|
|
|
46
46
|
|
|
47
47
|
private
|
|
48
48
|
|
|
49
|
-
def options(values, include_container: false)
|
|
49
|
+
def options(values, include_container: false, include_publish: true)
|
|
50
50
|
result = []
|
|
51
51
|
result.push('-w', values['workdir']) unless values['workdir'].to_s.empty?
|
|
52
52
|
values.fetch('env', {}).each { |key, value| result.push('-e', "#{key}=#{value}") }
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
if include_publish
|
|
54
|
+
Array(values['ports']).each { |port| result.push('-p', port.to_s) }
|
|
55
|
+
Array(values['volumes']).each { |volume| result.push('-v', volume.to_s) }
|
|
56
|
+
end
|
|
55
57
|
result << required(values, 'container') if include_container
|
|
56
58
|
result
|
|
57
59
|
end
|
data/lib/wip/version.rb
CHANGED