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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d901b8aceeac1eb343486a67392bffbc3935f01c987f82419c77e7a2ec92315f
4
- data.tar.gz: 22b98cda2762df2182f5e44e29f553ffc994a9e51d46a2adfca090981eaf6c88
3
+ metadata.gz: 5dd0714a5b73fc48e824d842aa8d4eb3f09f4c6cf3b72d3da04a9837bb8ce661
4
+ data.tar.gz: b2b9f7acd21647b482ef8cc799fd5df72832a6500fad45a81026aa9cf567726f
5
5
  SHA512:
6
- metadata.gz: 64cd20e668acb406d5bb43d2a830433e2c5c2042bee2fcfaaf4c027caed6b15f5d04cba91b9cf53009570d37741358b61966cc85fe4fbdec9ca0aff67ccfa8c9
7
- data.tar.gz: 941dc0e11840557a412db511fb05d50fd675059345f365a66c35dcf946f96e9f6c4b18ad0b47fb3eb7b1c940ff8c8fdaa4b4f6e7dd2d00863256508e98d08ee3
6
+ metadata.gz: 3200e00ca2b898b2ed00c7505ddb005a9ec5bacd5a29fa7c53a89306cbd9264898259e32e46c44ec54d43c618300d54d6324a573ee224aed8005902e82bc55c5
7
+ data.tar.gz: 56032bf6894c836b70ff22cfdd842b10d180778d362160bbb3156ab3f3a01e8be10c81b60edcfa332a38fb7936c1599ecb8c49285cccee2c0b503a169900edbb
data/TODO.md CHANGED
@@ -84,3 +84,7 @@ Do a ping test on available mirrors, and use fzf to select.
84
84
  ## Interrupt catcher
85
85
 
86
86
  Don't print backtrace when ^C is pressed.
87
+
88
+ ## Tests
89
+
90
+ Create fake OS environments that you can chroot into and run upm to test it out.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
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
- args.unshift "sudo" if root
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
- run("apt", "upgrade", root: true)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron