From 052169df1cfc686b70c23c84c4ee159451bc2c0d Mon Sep 17 00:00:00 2001 From: Timerix Date: Sun, 20 Oct 2024 10:36:57 +0500 Subject: [PATCH] pack.sh package selection --- pack.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pack.sh b/pack.sh index cf9d273..f809178 100755 --- a/pack.sh +++ b/pack.sh @@ -1,17 +1,10 @@ #!/usr/bin/bash set -eo pipefail -if [[ -d nuget ]]; then - echo "archiving old ./nuget/ content" - mkdir -p nuget_old - TIMESTAMP=$(date +%Y.%m.%d_%H-%M-%S) - mv nuget "nuget_$TIMESTAMP" - tar cvf "nuget_old/nuget_$TIMESTAMP.tar" "nuget_$TIMESTAMP" - rm -rf "nuget_$TIMESTAMP" -fi +rm -rf nuget mkdir nuget -function create_package() { +function build_package() { echo "----------[$1]----------" cd "$1" || return 1 dotnet pack -c Release -o bin/pack_tmp || return 1 @@ -21,9 +14,12 @@ function create_package() { cd .. } -echo "building packages" -create_package DTLib.Demystifier -create_package DTLib.XXHash -create_package DTLib -create_package DTLib.Logging.Microsoft +packages_to_build="$@" +if [ -z "$packages_to_build" ]; then + packages_to_build='DTLib.Demystifier DTLib.XXHash DTLib DTLib.Logging.Microsoft' +fi +echo "building packages $packages_to_build" +for p in $packages_to_build; do + build_package "$p" +done ls -shk nuget