From b679cd2e98c26589abb6417e08f824e0aa031778 Mon Sep 17 00:00:00 2001 From: Lisca Ana-Roberta <55219463+aokirisaki@users.noreply.github.com> Date: Thu, 30 Mar 2023 13:15:48 +0300 Subject: [PATCH] feat(ui): if zui tag is not found for download, it now builds locally from the commit (#1318) Signed-off-by: Ana-Roberta Lisca --- Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5b59c61e..6534baf1 100644 --- a/Makefile +++ b/Makefile @@ -410,8 +410,23 @@ ui: rm -rf ./pkg/extensions/build;\ cp -R $$tdir/zui/build ./pkg/extensions/;\ else\ - curl -fsSL https://github.com/project-zot/zui/releases/download/$(ZUI_VERSION)/zui.tgz -o zui.tgz;\ - tar xvzf zui.tgz -C ./pkg/extensions/;\ - rm zui.tgz;\ + curl --fail --head https://github.com/project-zot/zui/releases/download/$(ZUI_VERSION)/zui.tgz;\ + if [ $$? -ne 0 ]; then\ + pwd=$$(pwd);\ + tdir=$$(mktemp -d);\ + cd $$tdir;\ + git clone --depth=1 --branch $(ZUI_VERSION) https://github.com/project-zot/zui.git;\ + cd zui;\ + git checkout $(ZUI_VERSION);\ + npm install;\ + npm run build;\ + cd $$pwd;\ + rm -rf ./pkg/extensions/build;\ + cp -R $$tdir/zui/build ./pkg/extensions/;\ + else\ + curl -fsSL https://github.com/project-zot/zui/releases/download/$(ZUI_VERSION)/zui.tgz -o zui.tgz;\ + tar xvzf zui.tgz -C ./pkg/extensions/;\ + rm zui.tgz;\ + fi;\ fi;\