mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
remove unused zip command (#6676)
This commit is contained in:
parent
4606fcdbd5
commit
852429f248
1 changed files with 7 additions and 14 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
# used by the ci to rename build artifacts
|
# used by the ci to rename build artifacts
|
||||||
# renames the file to [original name][SUFFIX].[original extension]
|
# renames the file to [original name][SUFFIX].[original extension]
|
||||||
# where SUFFIX is either available in the environment or as the first arg
|
# where SUFFIX is either available in the environment or as the first arg
|
||||||
# if MAKE_ZIP is set instead a zip is made
|
|
||||||
# expected to be run in the build directory unless BUILD_DIR is set
|
# expected to be run in the build directory unless BUILD_DIR is set
|
||||||
# adds output to GITHUB_OUTPUT
|
# adds output to GITHUB_OUTPUT
|
||||||
builddir="${BUILD_DIR:=.}"
|
builddir="${BUILD_DIR:=.}"
|
||||||
|
|
@ -22,8 +21,8 @@ set -e
|
||||||
|
|
||||||
# find file
|
# find file
|
||||||
found="$(find "$builddir" -maxdepth 1 -type f -name "$findrx" -print -quit)"
|
found="$(find "$builddir" -maxdepth 1 -type f -name "$findrx" -print -quit)"
|
||||||
path="${found%/*}" # remove all after last /
|
path="${found%/*}" # remove all including first "/" from right side
|
||||||
file="${found##*/}" # remove all before last /
|
file="${found##*/}" # remove all including last "/" from left side
|
||||||
if [[ ! $file ]]; then
|
if [[ ! $file ]]; then
|
||||||
echo "::error file=$0::could not find package"
|
echo "::error file=$0::could not find package"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -35,18 +34,12 @@ if ! cd "$path"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set filename
|
# set filename
|
||||||
name="${file%.*}" # remove file extension
|
name="${file%.*}" # remove all including first "." from right side
|
||||||
new_name="$name$SUFFIX"
|
new_name="$name$SUFFIX"
|
||||||
if [[ $MAKE_ZIP ]]; then
|
extension="${file##*.}" # remove all including last "." from left side
|
||||||
filename="${new_name}.zip"
|
filename="$new_name.$extension"
|
||||||
echo "creating zip '$filename' from '$file'"
|
echo "renaming '$file' to '$filename'"
|
||||||
zip "$filename" "$file"
|
mv "$file" "$filename"
|
||||||
else
|
|
||||||
extension="${file##*.}" # remove all before last .
|
|
||||||
filename="$new_name.$extension"
|
|
||||||
echo "renaming '$file' to '$filename'"
|
|
||||||
mv "$file" "$filename"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$oldpwd"
|
cd "$oldpwd"
|
||||||
relative_path="$path/$filename"
|
relative_path="$path/$filename"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue