dctl_rb 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dctl/main.rb +7 -1
- data/lib/dctl/version.rb +1 -1
- 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: d1bcf89b457f36a029b21cd3c0036845070bd7193608edc26823dc12c924f86c
|
4
|
+
data.tar.gz: 3ec7f0b5b262203393069dc276fdbacbd037b9849ba7773adf23a7baf7c584df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c777f13aabf4e8fb8db107a36d95b4515a272182eaacf3ca448c579a4d8618e4f4bf161695f20e6b8eaeec5ec8dbc635115754103606888ffb130cb46234a8a8
|
7
|
+
data.tar.gz: b350b97c4bcd4f3c4c08c9a64db02c7589e83167c5bf3906b129ff358c216c1f6c052615fba033a068b638a3f8d5b12b2f6f3b291cb686cf4dbd34e52ac7842c
|
data/Gemfile.lock
CHANGED
data/lib/dctl/main.rb
CHANGED
@@ -155,8 +155,14 @@ module Dctl
|
|
155
155
|
def define_custom_commands(klass)
|
156
156
|
Array(settings.custom_commands).each do |command, args|
|
157
157
|
klass.send(:desc, command, "[Custom Command] #{command}")
|
158
|
+
|
159
|
+
# Concat with string so we can use exec rather than executing multiple
|
160
|
+
# subshells. Exec allows us to reuse the shell in which dctl is being
|
161
|
+
# executed, so we get to do things like reuse sudo authorizations
|
162
|
+
# rather than always having to prmopt.
|
163
|
+
concatenated = Array(args).join(" && ").strip
|
158
164
|
klass.send(:define_method, command, -> do
|
159
|
-
|
165
|
+
stream_output(concatenated, exec: true)
|
160
166
|
end)
|
161
167
|
end
|
162
168
|
end
|
data/lib/dctl/version.rb
CHANGED