Skip to content

Commit

Permalink
CLI fix offline save stacks to tars (eclipse-che#5269)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Iuvshyn committed Jun 2, 2017
1 parent ac8d44e commit 55e6720
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dockerfiles/base/scripts/base/commands/cmd_offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ cmd_offline() {
info "offline" "Optional: (repeat --image:<name> for stack, --all-stacks, or --no-stacks)"
for STACK in $(seq 0 $((${#STACK_IMAGE_LIST[@]}-1)))
do
info "offline" " STACK: ${STACK_IMAGE_LIST[$STACK]}"
if [ ! -z ${STACK_IMAGE_LIST[$STACK]} ]; then
info "offline" " STACK: ${STACK_IMAGE_LIST[$STACK]}"
fi
done

return 1
Expand Down Expand Up @@ -111,7 +113,9 @@ cmd_offline() {
--all-stacks)
for STACK in $(seq 0 $((${#STACK_IMAGE_LIST[@]}-1)))
do
download_and_save_image ${STACK_IMAGE_LIST[$STACK]}
if [ ! -z ${STACK_IMAGE_LIST[$STACK]} ]; then
download_and_save_image ${STACK_IMAGE_LIST[$STACK]}
fi
done
break
shift ;;
Expand All @@ -135,7 +139,7 @@ download_and_save_image() {
}

save_image(){
TAR_NAME=$(echo $1 | sed "s|\/|_|")
TAR_NAME=$(echo $1 | sed "s|\/|_|g")

if [ ! -f $CHE_CONTAINER_OFFLINE_FOLDER/$TAR_NAME.tar ]; then
info "offline" "Saving $CHE_HOST_OFFLINE_FOLDER/$TAR_NAME.tar..."
Expand Down

0 comments on commit 55e6720

Please sign in to comment.