Created
October 8, 2015 10:18
-
-
Save silvernode/8176550a87b0513fc678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative 'which' | |
require_relative 'managers' | |
require_relative 'pacman' | |
require_relative 'apt-get' | |
args=ARGV | |
argsShift=[] | |
for i in args do | |
argsShift.push(i) | |
end | |
argsShift.shift | |
for i in argsShift do | |
pkgArgs = "#{pkgArgs} #{i}" | |
end | |
#package managers to check for | |
pkgMgrs = ["#{$debianBased}", | |
"#{$archLinux}", | |
"#{$voidLinux}"] | |
#iterate over list of package managers | |
#pass this to which(), take result and set it to pkgMgr | |
for i in pkgMgrs do | |
if which(i) then | |
pkgMgr=i | |
break | |
end | |
end | |
#load file based on which package manager is found | |
pkgMgr(args[0], pkgArgs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment