upm 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO.md +4 -0
- data/VERSION +1 -1
- data/lib/upm/tool.rb +4 -2
- data/lib/upm/tools/apt.rb +5 -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: 5dd0714a5b73fc48e824d842aa8d4eb3f09f4c6cf3b72d3da04a9837bb8ce661
|
4
|
+
data.tar.gz: b2b9f7acd21647b482ef8cc799fd5df72832a6500fad45a81026aa9cf567726f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3200e00ca2b898b2ed00c7505ddb005a9ec5bacd5a29fa7c53a89306cbd9264898259e32e46c44ec54d43c618300d54d6324a573ee224aed8005902e82bc55c5
|
7
|
+
data.tar.gz: 56032bf6894c836b70ff22cfdd842b10d180778d362160bbb3156ab3f3a01e8be10c81b60edcfa332a38fb7936c1599ecb8c49285cccee2c0b503a169900edbb
|
data/TODO.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/upm/tool.rb
CHANGED
@@ -148,7 +148,7 @@ module UPM
|
|
148
148
|
raise "Error: command argument must be a String or an Array; it was a #{cmd.class}"
|
149
149
|
end
|
150
150
|
|
151
|
-
@cmds[name] = proc { |args| run(*shell_command, *args, paged: paged) }
|
151
|
+
@cmds[name] = proc { |args| run(*shell_command, *args, paged: paged, root: root) }
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -159,7 +159,9 @@ module UPM
|
|
159
159
|
## Helpers
|
160
160
|
|
161
161
|
def run(*args, root: false, paged: false, grep: nil)
|
162
|
-
|
162
|
+
if root and File.which("sudo")
|
163
|
+
args.unshift "sudo"
|
164
|
+
end
|
163
165
|
|
164
166
|
if !paged and !grep
|
165
167
|
system(*args)
|
data/lib/upm/tools/apt.rb
CHANGED
@@ -6,8 +6,11 @@ UPM::Tool.new "apt" do
|
|
6
6
|
command "update", "apt update", root: true
|
7
7
|
|
8
8
|
command "upgrade" do |args|
|
9
|
-
call_command("update")
|
10
|
-
|
9
|
+
if call_command("update")
|
10
|
+
run("apt", "upgrade", root: true)
|
11
|
+
else
|
12
|
+
puts "Error: couldn't 'apt update' package lists"
|
13
|
+
end
|
11
14
|
end
|
12
15
|
|
13
16
|
command "remove", "apt remove", root: true
|