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;\