File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,18 +10,21 @@ rm -rf packages
1010mkdir packages
1111
1212rename () {
13- if [ -z " $2 " ]; then
13+ # First parameter is package name
14+ # Second parameter is file pattern
15+ # Third optional parameter is gcc or clang
16+ if [ -z " $3 " ]; then
1417 fullname=$1
1518 else
16- fullname=" ${1} _${2 } "
19+ fullname=" ${1} _${3 } "
1720 fi
1821 # package file eg. mingw-w64-x86_64-libobjc2-2.3-3-any.pkg.tar.zst
19- filename=$( ls $3 2> /dev/null)
22+ filename=$( ls $2 2> /dev/null)
2023 if [ -z " $filename " ]; then
2124 echo " ❌ No file matching $3 found."
2225 exit 1
2326 fi
24- if [ " $2 " ]; then
27+ if [ " $3 " ]; then
2528 # add gcc or clang to filename
2629 newname=" ${filename/ $1 / $fullname } "
2730 mv $filename $newname
@@ -49,7 +52,7 @@ build_install() {
4952 exit 1
5053 fi
5154
52- filename=$( rename $1 $2 " *$1 *any.pkg.tar.zst" )
55+ filename=$( rename $1 " *$1 *any.pkg.tar.zst" $2 )
5356
5457 if ! pacman -U $filename --noconfirm ; then
5558 echo " ❌ $filename install failed!"
You can’t perform that action at this time.
0 commit comments