From 67caf00f289fe67550a84ac6739591d2ffa93ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 23 Jul 2016 22:16:47 +0200 Subject: [PATCH] [fix] Run npm/gulp at build in Debian rules The assets building - e.g. npm and bower installation followed by build task - must be done in the build sequence instead of the install one. The main reason is logic, we are building something. The second one - which we "fixed" by adding extra arguments to npm and bower - is due to the user who runs those sequences: *build* uses a non-privileged one while *install* uses root. It resulted in npm and bower complaining about using the root user. Since 03e979f, bower installation is integrated to npm postinstall, that's why this issue reappears. This commit also removes the useless `bower install` command. --- debian/rules | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index aa0aad78..b0315118 100755 --- a/debian/rules +++ b/debian/rules @@ -14,16 +14,13 @@ TMPDIR = $$(pwd)/debian/yunohost-admin %: dh $@ -override_dh_auto_install: +override_dh_auto_build: # Replace VERSION with current package version to prevent web browser # to serve old css/js files sed -i 's/VERSION/$(DEBVERS)/g' src/index.html # Run npm/bower/gulp - # For some unknown reason, the postinstall scripts in package.json cannot be run, and triggers this error : - # "npm WARN cannot run in wd yunohost-admin@ bower install && gulp build (wd=/build/path)" - cd src ; npm --progress false --loglevel warn --color false --unsafe-perm install - cd src ; node_modules/bower/bin/bower install --allow-root + cd src ; npm --progress false --loglevel warn --color false install cd src ; node_modules/gulp/bin/gulp.js build override_dh_clean: