bash_help 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bash_help.rb +1 -0
- data/lib/general_helpers.rb +8 -0
- 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: 0e6351dbe0a2ca1473d06c15a41460079b6bc53ebd46f7a9984b8ddbb5b67f70
|
4
|
+
data.tar.gz: 2c0a520522035fde608a777168ca921269cac0099ff3f202b4c05a95b79230ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3a2940b69d6729f5871fce4f77f0a7044fc7052e247699bc26dca7f3040f67dcf8384d1c6d0bdec97bb8f83213125050bcbcb917c35f454caa1a1f515677cc
|
7
|
+
data.tar.gz: c156f96ebf96172ebfa27fb765eaaaa4164533563c3c7ea5251dcf61082f10f4fc02ae4a9524aa7c6810b33177bb16d8e6f483068b321b8dac93f7e07203ff7f
|
data/lib/bash_help.rb
CHANGED
data/lib/general_helpers.rb
CHANGED
@@ -8,3 +8,11 @@ def normalize(path)
|
|
8
8
|
dirpath = File.dirname(filepath)
|
9
9
|
Dir.chdir(dirpath)
|
10
10
|
end
|
11
|
+
|
12
|
+
# system(command), but aborts if the command fails.
|
13
|
+
def safe_system(command)
|
14
|
+
unless system(command)
|
15
|
+
puts "Command '#{command}' failed. Aborting."
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
end
|