From 7a1cfbcef873b10e06f29349605d3310735b14d7 Mon Sep 17 00:00:00 2001 From: lexluo09 <39718951+lexluo09@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:02:35 +0800 Subject: [PATCH] (improvement)(build) moveToRuntime checks if the tar.gz file exists, and if it doesn't, no operation is performed. (#544) --- assembly/bin/supersonic-common.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/assembly/bin/supersonic-common.sh b/assembly/bin/supersonic-common.sh index a697c5b9c..de20b2627 100755 --- a/assembly/bin/supersonic-common.sh +++ b/assembly/bin/supersonic-common.sh @@ -29,11 +29,15 @@ function setEnvToWeb { function moveToRuntime { model_name=$1 - tar -zxvf ${buildDir}/supersonic-${model_name}.tar.gz -C ${runtimeDir} - mv ${runtimeDir}/launchers-${model_name}-* ${runtimeDir}/supersonic-${model_name} - - mkdir -p ${runtimeDir}/supersonic-${model_name}/webapp - cp -fr ${buildDir}/webapp/* ${runtimeDir}/supersonic-${model_name}/webapp + file="${buildDir}/supersonic-${model_name}.tar.gz" + if [ -f "$file" ]; then + tar -zxvf "$file" -C ${runtimeDir} + mv ${runtimeDir}/launchers-${model_name}-* ${runtimeDir}/supersonic-${model_name} + mkdir -p ${runtimeDir}/supersonic-${model_name}/webapp + cp -fr ${buildDir}/webapp/* ${runtimeDir}/supersonic-${model_name}/webapp + else + echo "File $file does not exist. Skipping the move to runtime." + fi } function moveAllToRuntime {