rakit 0.1.15 → 0.1.16
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 +4 -4
- data/lib/rakit/shell.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f3d31e09825b67791824b975aab507a6831b6e2028ae4a17db2cb53ebb01840
|
|
4
|
+
data.tar.gz: 9238db6c464534eb481f9e6dd6011768b6b7158ca08887756fdb0f33479437de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2ffcd048b96ce26a785e8fb05bf95592e8028856795ed88523d940f3c4ec5e4701543ac36573cf055a293523c5706ad3ea44467555c167a2c6d512c8fb6b801
|
|
7
|
+
data.tar.gz: 7a2009c45ea2234696cc6e79673988a86871eac8283bb3b3ed41aecd7f5b0b42744179ffe195953b42194ba443ec45677ef7f97d433896b4d8a75fd35b98b7fa
|
data/lib/rakit/shell.rb
CHANGED
|
@@ -186,10 +186,18 @@ module Rakit
|
|
|
186
186
|
end
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
-
# Run a shell command string
|
|
189
|
+
# Run a shell command string. On Unix uses +sh -c+; on Windows uses +COMSPEC+ (usually +cmd.exe /c+)
|
|
190
|
+
# so we do not require a POSIX shell (avoids Errno::ENOENT for +sh+ on plain Windows).
|
|
190
191
|
# Prints ✓ (green) + cmd on success, or ✗ (red) + cmd then stdout/stderr on failure. Returns the Command with result fields set.
|
|
191
192
|
def self.run(cmd)
|
|
192
|
-
command =
|
|
193
|
+
command =
|
|
194
|
+
if Gem.win_platform?
|
|
195
|
+
exe = ENV["COMSPEC"].to_s.strip
|
|
196
|
+
exe = "cmd.exe" if exe.empty?
|
|
197
|
+
Command.new(name: exe, args: ["/c", cmd.to_s], working_directory: "")
|
|
198
|
+
else
|
|
199
|
+
Command.new(name: "sh", args: ["-c", cmd.to_s], working_directory: "")
|
|
200
|
+
end
|
|
193
201
|
result = CommandService.execute(command)
|
|
194
202
|
if result.exit_status == 0
|
|
195
203
|
puts "#{CHECK} #{cmd}"
|