blackstack-nodes 1.2.15 → 1.2.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/blackstack-nodes.rb +9 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: baa210daeea5b1e58fb15147e50003cef8e154085926c2b85cc80701965d3c92
4
- data.tar.gz: d68c0e01dcd790b4bc3032f25bc7b8159cb1287260ce7c41b00eed02ee176553
3
+ metadata.gz: 7030c06d185e9257db6bcf42deadcbcc1ac609f79140b8ce63f73f5368232144
4
+ data.tar.gz: adc175dd676a9b3940454342016ec82b96d771f885f6ca92d26f317d5f722331
5
5
  SHA512:
6
- metadata.gz: 74e04021b9f39eb587a0a2471e2bf1406dca2be895e65af0316c0dc89a94652148ac1a16c6ab5b16cc073f5b4cfa0bbf0414e13961357e5695e7a834e98eeec8
7
- data.tar.gz: ab8d5169af5376d2c6e52251a4b1e4b76c9e45187ec1db42dd18741a8eaf1a2865293bfda6f68bdb279f42ed9ea75b617240dfe70eab04ff09992ef3182c6dea
6
+ metadata.gz: 2d3807f8df44577cff9d4b57329ad28e2a6216bce5566a178893ed390c2b6f943b45ddbd561b2fa793506010a586108468eb0e05c53e55ce81f36c74089bb2eb
7
+ data.tar.gz: 3cf124a33af4fcffaa3fd2b642fe561774d296cc629cc67d0e9bb865425eb5688fa13bf0e68b89a0272c1c7337b1fb06490b4669c86165bd421bbc88ef68d37a
@@ -128,16 +128,19 @@ module BlackStack
128
128
  #
129
129
  def exec(
130
130
  command,
131
- output_file: "~/.bash-command-stdout-buffer",
132
- error_file: "~/.bash-command-stderr-buffer",
133
- exit_code_file: "~/.bash-command-exit-code"
131
+ output_file: "$HOME/.bash-command-stdout-buffer",
132
+ error_file: "$HOME/.bash-command-stderr-buffer",
133
+ exit_code_file: "$HOME/.bash-command-exit-code"
134
134
  )
135
135
  # Construct the remote command with redirection for stdout, stderr, and capturing exit code
136
136
  remote_command = "#{command} > #{output_file} 2> #{error_file}; echo $? > #{exit_code_file}"
137
-
137
+
138
138
  # Execute the command on the remote server, truncating output, error, and exit code files
139
- self.ssh.exec!("truncate -s 0 #{output_file} #{error_file} #{exit_code_file} && #{remote_command}")
140
-
139
+ self.ssh.exec!("truncate -s 0 #{output_file} #{error_file} #{exit_code_file}")
140
+
141
+ # Execute the command on the remote server, truncating output, error, and exit code files
142
+ self.ssh.exec!(remote_command)
143
+
141
144
  # Retrieve the exit code
142
145
  exit_code = self.ssh.exec!("cat #{exit_code_file}").to_s.chomp.to_i
143
146
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackstack-nodes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.15
4
+ version: 1.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-20 00:00:00.000000000 Z
11
+ date: 2024-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh