Run shellcheck
This commit is contained in:
parent
7c7fe3a4a1
commit
1afeff00d8
|
@ -273,12 +273,11 @@ getThePackages() {
|
||||||
packages=$(whiptail --title "Packages" --separate-output --checklist "Press TAB to select Ok or Cancel. If you don't want to install any packages, press Cancel." 28 50 19 "${options[@]}" 3>&1 1>&2 2>&3)
|
packages=$(whiptail --title "Packages" --separate-output --checklist "Press TAB to select Ok or Cancel. If you don't want to install any packages, press Cancel." 28 50 19 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||||
tempFile=$(mktemp)
|
tempFile=$(mktemp)
|
||||||
for package in $packages; do
|
for package in $packages; do
|
||||||
grep "^$package," packages.csv >> $tempFile
|
grep "^$package," packages.csv >> "$tempFile"
|
||||||
done
|
done
|
||||||
header=$(head -n1 packages.csv)
|
header=$(head -n1 packages.csv)
|
||||||
printf '%s\n%s' "$(cat packages.csv | sed -n '2~1p')" "$(cat $tempFile)" | sort | uniq -d > packages.csv
|
packages=$(sort <(sed -n '2~1p' packages.csv) <(cat "$tempFile") | uniq -d)
|
||||||
sed -i "1s/^/${header}\n/" packages.csv
|
printf '%s\n%s' "$header" "$packages" > packages.csv
|
||||||
rm $tempFile
|
|
||||||
fi
|
fi
|
||||||
local IFS=,
|
local IFS=,
|
||||||
while read -r NAME IMPORTANT INSTALLER; do
|
while read -r NAME IMPORTANT INSTALLER; do
|
||||||
|
|
Loading…
Reference in New Issue