mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
enh: also use yarn for web admin
This commit is contained in:
parent
5c8e3e773b
commit
c08c9a948b
1 changed files with 10 additions and 19 deletions
29
ynh-dev
29
ynh-dev
|
@ -308,13 +308,13 @@ function use_git()
|
||||||
;;
|
;;
|
||||||
yunohost-admin)
|
yunohost-admin)
|
||||||
|
|
||||||
mkdir -p /var/cache/ynh-dev/yunohost-admin/
|
local DEV_PATH="/ynh-dev/yunohost-admin/app"
|
||||||
create_sym_link "/ynh-dev/yunohost-admin/app/.env" "/var/cache/ynh-dev/yunohost-admin/.env"
|
local CACHE_PATH="/var/cache/ynh-dev/yunohost-admin"
|
||||||
create_sym_link "/var/cache/ynh-dev/yunohost-admin/node_modules" "/ynh-dev/yunohost-admin/app/node_modules"
|
|
||||||
create_sym_link "/ynh-dev/yunohost-admin/app/package.json" "/var/cache/ynh-dev/yunohost-admin/package.json"
|
|
||||||
create_sym_link "/ynh-dev/yunohost-admin/app/package-lock.json" "/var/cache/ynh-dev/yunohost-admin/package-lock.json"
|
|
||||||
|
|
||||||
cd /var/cache/ynh-dev/yunohost-admin/
|
create_sym_link "/ynh-dev/yunohost-admin/app/.env" "/var/cache/ynh-dev/yunohost-admin/.env"
|
||||||
|
prepare_cache_and_deps "$DEV_PATH" "$CACHE_PATH"
|
||||||
|
|
||||||
|
cd "$CACHE_PATH"
|
||||||
|
|
||||||
# Inject container ip in .env file
|
# Inject container ip in .env file
|
||||||
# Used by vite to expose itself on network and proxy api requests.
|
# Used by vite to expose itself on network and proxy api requests.
|
||||||
|
@ -337,18 +337,9 @@ with open(setting_file) as f:
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install dependencies with npm install (or rather npm ci)
|
cd "$DEV_PATH"
|
||||||
if [[ -e "/var/cache/ynh-dev/yunohost-admin/node_modules/vue" ]];
|
info "Now running dev server"
|
||||||
then
|
yarn dev --host
|
||||||
info "NB: skipping npm ci because vue is already installed. If you want to upgrade/refresh npm dependencies, you should run 'npm ci' manually, or delete /var/cache/ynh-dev/yunohot-admin/node_modules."
|
|
||||||
else
|
|
||||||
info "Installing npm dependencies ... (this may take a while)"
|
|
||||||
npm ci --no-bin-links
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd /ynh-dev/yunohost-admin/app/
|
|
||||||
info "Now running 'npm run dev'"
|
|
||||||
npm run dev
|
|
||||||
;;
|
;;
|
||||||
yunohost-admin-build)
|
yunohost-admin-build)
|
||||||
if [[ ! -e "/usr/share/yunohost/admin-bkp" ]]
|
if [[ ! -e "/usr/share/yunohost/admin-bkp" ]]
|
||||||
|
@ -358,7 +349,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /ynh-dev/yunohost-admin/app
|
cd /ynh-dev/yunohost-admin/app
|
||||||
npm run build
|
yarn build
|
||||||
|
|
||||||
create_sym_link "/ynh-dev/yunohost-admin/app/dist" "/usr/share/yunohost/admin"
|
create_sym_link "/ynh-dev/yunohost-admin/app/dist" "/usr/share/yunohost/admin"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue