Skip to content
Snippets Groups Projects
Commit 05053a9f authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

packages2install: add missing function _filterPkg

parent bd9befb3
Branches
No related tags found
No related merge requests found
...@@ -56,7 +56,18 @@ function _exec(){ ...@@ -56,7 +56,18 @@ function _exec(){
fi fi
} }
# apply filter on incoming piped data
# filter is a param with spaced keywords that will be transformed
# to a regex
# param1 text if filter keywords (seperated by space)
function _filterPkg(){
local _filter=$( echo $1 | tr " " "|" )
grep -E "^($_filter)"
}
# autodetect a package manager using which with
# a list of known pkg managers
function detectPkgManager(){ function detectPkgManager(){
local _list="apt yum pamac" local _list="apt yum pamac"
local out=$( _exec "which $_list 2>/dev/null" ) local out=$( _exec "which $_list 2>/dev/null" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment