dependabot-common 0.134.0 → 0.134.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: 0a13269cdce44f6825aaecb4f83eab183899fc14f82bd136ee298af764ca2154
4
- data.tar.gz: c6c86c3a0f92a9866585bbf8ae8cd0a70e9c22e954ec34d9f307a88e446bffd7
3
+ metadata.gz: 8c08f267c4282a28ad26915297e4b237d1d5e8899378cc8b19241a5d64a02b10
4
+ data.tar.gz: 228da9e6e4e79f2ad2d61772cc451e3183cbe6c66a2aace2bd4be6bfec903963
5
5
  SHA512:
6
- metadata.gz: ec0fc8151797fb628a766b085c8722909c3f022892e7c40459c9f31f566ade80e968675dcd1130bef219125291810ace61217510c1d7bb9106356215279b7f45
7
- data.tar.gz: 51330ed03dae58b1d7ca806ebeeac41990bc78254da4651952a95aec327c6701117af4e3dd6f15e25d95c42fb8f8fe2a41d62be33e370ab8bc0509a9ee9ee541
6
+ metadata.gz: 817b688601c2677412bc3c274ec8bfac5d53e019897bc0586418dbefa3f3b2561178d3de401df5b922926c962eb639c0b28f7920084c0397d3915f8ff0b0a0b9
7
+ data.tar.gz: 1d421cf37f8ad3ee8828e28685a24cc77236f87d7086a0957ed25f1275428c8d7ab20cf7e1c3bcb21db645f264fbd9c66e065e1f6b971cae44e233cc49c41eda
@@ -75,13 +75,17 @@ module Dependabot
75
75
  start = Time.now
76
76
  stdin_data = JSON.dump(function: function, args: args)
77
77
  cmd = allow_unsafe_shell_command ? command : escape_command(command)
78
- env_cmd = [env, cmd].compact
78
+
79
+ # NOTE: For debugging native helpers in specs and dry-run: outputs the
80
+ # bash command to run in the tmp directory created by
81
+ # in_a_temporary_directory
79
82
  if ENV["DEBUG_FUNCTION"] == function
80
- escaped_stdin_data = stdin_data.gsub("\"", "\\\"")
81
- puts "$ cd #{Dir.pwd} && echo \"#{escaped_stdin_data}\" | #{env_cmd.join(' ')}"
83
+ puts helper_subprocess_bash_command(stdin_data: stdin_data, command: cmd, env: env)
82
84
  # Pause execution so we can run helpers inside the temporary directory
83
85
  byebug # rubocop:disable Lint/Debugger
84
86
  end
87
+
88
+ env_cmd = [env, cmd].compact
85
89
  stdout, stderr, process = Open3.capture3(*env_cmd, stdin_data: stdin_data)
86
90
  time_taken = Time.now - start
87
91
 
@@ -286,5 +290,12 @@ module Dependabot
286
290
  error_context: error_context
287
291
  )
288
292
  end
293
+
294
+ def self.helper_subprocess_bash_command(command:, stdin_data:, env:)
295
+ escaped_stdin_data = stdin_data.gsub("\"", "\\\"")
296
+ env_keys = env ? env.compact.map { |k, v| "#{k}=#{v}" }.join(" ") + " " : ""
297
+ "$ cd #{Dir.pwd} && echo \"#{escaped_stdin_data}\" | #{env_keys}#{command}"
298
+ end
299
+ private_class_method :helper_subprocess_bash_command
289
300
  end
290
301
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.134.0"
4
+ VERSION = "0.134.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.134.0
4
+ version: 0.134.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit