assemblyline-cli 0.0.7 → 0.0.8

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
  SHA1:
3
- metadata.gz: 0e4d9c5da410f82b87d264d272100f55a0cc8e71
4
- data.tar.gz: 66eb2a8ccee7faa4f1b71fc128e025f5f1ed19eb
3
+ metadata.gz: edd099b797138ae441122b355e03c4b1f1469d1c
4
+ data.tar.gz: 0090fba2a2f7a4d5ba762b8eae3a1e3168caff77
5
5
  SHA512:
6
- metadata.gz: de32c7559d592245e4e00dca60cae50262de03d8e88bc78faa3bd50f985c82f4e179e5644ddd153c810e3ddac9705e58887c3fa98b3c1c3cc647b645b7ba8245
7
- data.tar.gz: 4b4c49b66c8add2fd3a041242d5b600c32416b8f9f50d83b1802e81121fe0ca8b160e5482f416020892fbbae461643defb33b6bcc76daf40f37587a112687ee7
6
+ metadata.gz: c1c778e8371bb90bf7a1799c724ce1370325e7251ffd92f531e0ba7d1e9decc55a1943b925820849982ec57785cd534168b704e86147e0d1bfb80a78b7a2fa6e
7
+ data.tar.gz: d7e30c6d05ac6ba2d00cfc7171e060fb76b2ccc2fa52faabe5e31007431b9dd47ca1173d929ae0fbf3b546a05d9e5070367fe665c0c77b54bbff662b41aa50fd
@@ -10,7 +10,7 @@ module Assemblyline
10
10
  option :dev, type: :string, desc: 'use a local dev checkout of assemblyline-builder', banner: 'PATH'
11
11
  def build(url_or_path)
12
12
  init_local_mount url_or_path
13
- exec "docker run --rm #{bind_mounts} #{env_flags} #{debug_flags} #{local_mount} #{assemblyline_builder} bin/build #{build_command(url_or_path)}" # rubocop:disable Metrics/LineLength
13
+ exec "docker run --rm #{bind_mounts} #{env_flags} #{debug_flags} #{dev_mount} #{local_mount} #{assemblyline_builder} bin/build #{build_command(url_or_path)}" # rubocop:disable Metrics/LineLength
14
14
  end
15
15
 
16
16
  desc 'update', 'update assemblyline'
@@ -48,18 +48,23 @@ module Assemblyline
48
48
 
49
49
  def init_local_mount(path)
50
50
  return unless dir?(path)
51
- @local_mount = "-v #{File.expand_path(Dir.pwd, path)}:/usr/assemblyline/local"
51
+ @local_mount = "-v #{File.expand_path(path, Dir.pwd)}:/usr/assemblyline/local"
52
52
  end
53
53
 
54
54
  def dir?(path)
55
- File.directory?(File.expand_path(Dir.pwd, path))
55
+ File.directory?(File.expand_path(path, Dir.pwd))
56
56
  end
57
57
 
58
58
  def debug_flags
59
- return unless options[:debug]
59
+ return unless options[:debug] || options[:dev]
60
60
  '-ti'
61
61
  end
62
62
 
63
+ def dev_mount
64
+ return unless options[:dev]
65
+ "-v #{File.expand_path(options[:dev], Dir.pwd)}:/usr/src"
66
+ end
67
+
63
68
  def env_flags
64
69
  env.map { |var, val| "-e #{var}=#{val}" }.join(' ')
65
70
  end
@@ -1,3 +1,3 @@
1
1
  module Assemblyline
2
- CLI_VERSION = '0.0.7'
2
+ CLI_VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assemblyline-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson