[buildset] move functions to util
This commit is contained in:
parent
c14135d13c
commit
926c362153
1 changed files with 0 additions and 32 deletions
|
@ -16,38 +16,6 @@ SYSCONFDIR='@sysconfdir@'
|
|||
[[ -r @libdir@/util-msg.sh ]] && source @libdir@/util-msg.sh
|
||||
[[ -r @libdir@/util.sh ]] && source @libdir@/util.sh
|
||||
|
||||
create_set(){
|
||||
msg "[$1/${name}.set]"
|
||||
if [[ -f $1/${name}.set ]];then
|
||||
msg3 "Backing up $1/${name}.set.orig"
|
||||
mv "$1/${name}.set" "$1/${name}.set.orig"
|
||||
fi
|
||||
local list=$(find * -maxdepth 0 -type d | sort)
|
||||
for item in ${list[@]};do
|
||||
if [[ -f $item/$2 ]];then
|
||||
cd $item
|
||||
msg2 "Adding ${item##*/}"
|
||||
echo ${item##*/} >> $1/${name}.set || break
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
remove_set(){
|
||||
if [[ -f $1/${name}.set ]]; then
|
||||
msg "Removing [$1/${name}.set] ..."
|
||||
rm $1/${name}.set
|
||||
fi
|
||||
}
|
||||
|
||||
show_set(){
|
||||
local list=$(cat $1/${name}.set)
|
||||
msg "Content of [$1/${name}.set] ..."
|
||||
for item in ${list[@]}; do
|
||||
msg2 "$item"
|
||||
done
|
||||
}
|
||||
|
||||
load_user_info
|
||||
|
||||
load_config "${USER_CONFIG}/manjaro-tools.conf"
|
||||
|
|
Loading…
Reference in a new issue