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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8e5f43bc1610d2c7af26c4ed9052ca4a055bcbbc97957f756452b5992b020b3
4
- data.tar.gz: 24299f3953026ccde81f3bc485234769aa417bac0bc6a22ab37c82ce76d1c8ac
3
+ metadata.gz: 996355115196c1437d3e06148ccc257c8d39dc5c98905643b979ff032de1775c
4
+ data.tar.gz: c10bb414811f0e7ab33d3fcf5a80f360d8b4f61aa374120d03c394eca22b1429
5
5
  SHA512:
6
- metadata.gz: 643895970056693e00703eddbecb9303fafd798bfe1f2ea005435f5b6daf36678e687784a75105fb88dbc01ca524060d4a9b8862ab3b38fce8121a577bcd868f
7
- data.tar.gz: 0542772f24b25763b610aba4d940f589bae73327f444103d77e9c899b6376f73ffcb78ce6a56c91fd180a5c1ac053e0ea8e5269008919d19541036d7d0550aa0
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}"
@@ -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
- Array(values['ports']).each { |port| result.push('-p', port.to_s) }
54
- Array(values['volumes']).each { |volume| result.push('-v', volume.to_s) }
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wip
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wslc-wip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wip contributors