mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
Adapt ynh-dev for new way to install yunohost-admin deps
This commit is contained in:
parent
34ab555ca5
commit
e40dd78323
1 changed files with 26 additions and 16 deletions
42
ynh-dev
42
ynh-dev
|
@ -277,28 +277,38 @@ function use_git()
|
||||||
useradd ynhdev
|
useradd ynhdev
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /var/cache/ynh-dev/yunohost-admin/{bower_components,node_modules,dist}
|
mkdir -p /var/cache/ynh-dev/yunohost-admin/
|
||||||
chown -R ynhdev /var/cache/ynh-dev/yunohost-admin/{bower_components,node_modules,dist}
|
mkdir -p /var/cache/ynh-dev/yunohost-admin/dist
|
||||||
|
chown -R ynhdev /var/cache/ynh-dev/yunohost-admin/
|
||||||
|
create_sym_link "/ynh-dev/yunohost-admin/src/package.json" "/var/cache/ynh-dev/yunohost-admin/package.json"
|
||||||
|
create_sym_link "/ynh-dev/yunohost-admin/src/package-lock.json" "/var/cache/ynh-dev/yunohost-admin/package-lock.json"
|
||||||
|
create_sym_link "/ynh-dev/yunohost-admin/src" "/usr/share/yunohost/admin"
|
||||||
|
|
||||||
# Install npm dependencies if needed
|
if [ ! -e /ynh-dev/yunohost-admin/src/dist ]
|
||||||
which gulp > /dev/null
|
|
||||||
if [ $? -eq 1 ]
|
|
||||||
then
|
then
|
||||||
info "Installing dependencies to develop in yunohost-admin ..."
|
echo "If npm install fails to create the dist and node_modules folder, maybe you need to run the following *in the host!* : "
|
||||||
|
echo " "
|
||||||
curl -sL https://deb.nodesource.com/setup_10.x | bash -
|
echo "cd /your/dev/env/yunohost-admin/src/"
|
||||||
apt install nodejs -y
|
echo "ln -s /var/cache/ynh-dev/yunohost-admin/dist ./dist"
|
||||||
|
echo "ln -s /var/cache/ynh-dev/yunohost-admin/node_modules ./node_modules"
|
||||||
npm install -g bower
|
echo " "
|
||||||
npm install -g gulp
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /ynh-dev/yunohost-admin/src
|
# Install npm dependencies if needed
|
||||||
npm install --no-bin-links
|
cd /var/cache/ynh-dev/yunohost-admin/
|
||||||
create_sym_link "/ynh-dev/yunohost-admin/src" "/usr/share/yunohost/admin"
|
if [ ! -e node_modules/gulp/bin/gulp.js ]
|
||||||
|
then
|
||||||
|
info "Installing dependencies to develop in yunohost-admin ..."
|
||||||
|
apt install nodejs npm -y
|
||||||
|
npm install -g npm@latest
|
||||||
|
fi
|
||||||
|
|
||||||
|
npm ci --no-bin-links
|
||||||
|
|
||||||
success "Now using Git repository for yunohost-admin"
|
success "Now using Git repository for yunohost-admin"
|
||||||
|
|
||||||
|
cd /ynh-dev/yunohost-admin/src
|
||||||
|
su ynhdev -c "./node_modules/gulp/bin/gulp.js build --dev"
|
||||||
warn "-------------------------------------------------------- "
|
warn "-------------------------------------------------------- "
|
||||||
warn "Launching gulp ... "
|
warn "Launching gulp ... "
|
||||||
warn "NB : This command will keep running and watch for changes"
|
warn "NB : This command will keep running and watch for changes"
|
||||||
|
@ -306,7 +316,7 @@ function use_git()
|
||||||
warn "don't need to re-run npm yourself everytime you change "
|
warn "don't need to re-run npm yourself everytime you change "
|
||||||
warn "something ! "
|
warn "something ! "
|
||||||
warn "-------------------------------------------------------- "
|
warn "-------------------------------------------------------- "
|
||||||
su ynhdev -c "gulp --dev"
|
su ynhdev -c "./node_modules/gulp/bin/gulp.js watch --dev"
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue