-
-
Save silvernode/7f32d8838ca0a7cc65e3 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
#use which to find package manager | |
#package managers to check for | |
pkgMgrs = ["apt-get", | |
"pacman"] | |
#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 | |
#pkgMgr should now be set to either apt-get or pacman | |
#I have functions already made: apt-get() and pacman() | |
#since I don't know which result pkgMgr is going to have, | |
#I want to simply load the correct function automatically | |
$pkgMgr() | |
#however this doesn't seem to work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment