mux_tf 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d3511e5badfa499bd43efb92048717c8d597633229c4e135a51c0d57ea56d84
4
- data.tar.gz: 3a2feb35ce3d7a9c4f2781b2ace26eb08ed41da0ba047b33a8b4882363878914
3
+ metadata.gz: 1a5386f0053732c1613b294b19bd94890a3dc5dbea9a6a443a35e6ca78ca0d36
4
+ data.tar.gz: 263c0bbe4fe2de06e2833f5640ad7bfb0e69814a37a8a199a9e360c99308cf28
5
5
  SHA512:
6
- metadata.gz: 7559eca291ace43436b5f38ea72823187573c85e7b51029861bf98a4e3b88b9144f0997a915a9ab1e9cb581ddc04807b9a9da569dd233a47207007fae5939b57
7
- data.tar.gz: 15d909df002d4ff344e2966eb2a54d3943407f6d9e910daebc84781de233f215bfa282067f7cf3eaf702811553785e785be9c5d8a437908e8b0f30d1efa911b8
6
+ metadata.gz: 56b45e534766f0efcdad2b008ecc3d0c7fe016ae4a0fed5009ca2df9094832d218aa3793b081cbf9e78d59b1cb847a3b9038bd5de41fa18e9f9ecaf2f914dcd9
7
+ data.tar.gz: b9d94d51350c22a7c1004194877cf2314f84208394711a3edd16cbd640d86332c1d12966089c656d242ea40977bd3dd9a9bb45b1439e606550366c53a138929a
@@ -1,8 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- $LOAD_PATH << File.expand_path(File.join(__dir__, '..', 'lib'))
4
+ begin
5
+ $LOAD_PATH << File.expand_path(File.join(__dir__, "..", "lib"))
5
6
 
6
- require 'mux_tf'
7
+ require "mux_tf"
7
8
 
8
- MuxTf::Cli.run(:current, ARGV)
9
+ MuxTf::Cli.run(:current, ARGV)
10
+ rescue Exception => e
11
+ warn e.full_message
12
+ warn "<press enter>"
13
+ gets
14
+ exit 1
15
+ end
data/exe/tf_mux CHANGED
@@ -1,8 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- $LOAD_PATH << File.expand_path(File.join(__dir__, '..', 'lib'))
4
+ begin
5
+ $LOAD_PATH << File.expand_path(File.join(__dir__, "..", "lib"))
5
6
 
6
- require 'mux_tf'
7
+ require "mux_tf"
7
8
 
8
- MuxTf::Cli.run(:mux, ARGV)
9
+ MuxTf::Cli.run(:mux, ARGV)
10
+ rescue Exception => e
11
+ warn e.full_message
12
+ warn "<press enter>"
13
+ gets
14
+ exit 1
15
+ end
@@ -1,8 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- $LOAD_PATH << File.expand_path(File.join(__dir__, '..', 'lib'))
4
+ begin
5
+ $LOAD_PATH << File.expand_path(File.join(__dir__, "..", "lib"))
5
6
 
6
- require 'mux_tf'
7
+ require "mux_tf"
7
8
 
8
- MuxTf::Cli.run(:plan_summary, ARGV)
9
+ MuxTf::Cli.run(:plan_summary, ARGV)
10
+ rescue Exception => e
11
+ warn e.full_message
12
+ warn "<press enter>"
13
+ gets
14
+ exit 1
15
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "bundler"
4
+
3
5
  module MuxTf
4
6
  module Cli
5
7
  module Mux
@@ -7,6 +9,21 @@ module MuxTf
7
9
  extend PiotrbCliUtils::ShellHelpers
8
10
 
9
11
  class << self
12
+ def with_clean_env
13
+ backup = {}
14
+ Bundler.with_original_env do
15
+ ENV.keys.grep(/^(RBENV_|RUBYLIB)/).each do |key|
16
+ backup[key] = ENV[key]
17
+ ENV.delete(key)
18
+ end
19
+ yield
20
+ end
21
+ ensure
22
+ backup.each do |k, v|
23
+ ENV[k] = v
24
+ end
25
+ end
26
+
10
27
  def run(_args)
11
28
  Dotenv.load(".env.mux")
12
29
 
@@ -38,9 +55,13 @@ module MuxTf
38
55
  end
39
56
 
40
57
  log "Starting new session ..."
41
- Tmux.new_session project
58
+ with_clean_env do
59
+ Tmux.new_session project
60
+ end
42
61
  Tmux.select_pane "initial"
43
62
 
63
+ # Tmux.set "remain-on-exit", "on"
64
+
44
65
  Tmux.set_hook "pane-exited", "select-layout tiled"
45
66
  Tmux.set_hook "window-pane-changed", "select-layout tiled"
46
67
 
@@ -68,6 +89,8 @@ module MuxTf
68
89
 
69
90
  puts "\e]0;tmux: #{project}\007"
70
91
 
92
+ sleep 5
93
+
71
94
  log "Attaching ..."
72
95
  Tmux.attach(project, cc: !!ENV["MUXP_CC_MODE"])
73
96
  log "Done!"
@@ -177,7 +177,7 @@ module MuxTf
177
177
  resource, parent_address = find_config(data["configuration"], "root_module", address, [])
178
178
  if resource
179
179
  deps = []
180
- resource["expressions"].each do |_k, v|
180
+ resource["expressions"]&.each do |_k, v|
181
181
  deps << v["references"] if v.is_a?(Hash) && v["references"]
182
182
  end
183
183
  result += deps.map { |s| (parent_address + [s]).join(".") }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuxTf
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mux_tf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-05 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport