diff --git a/Makefile b/Makefile index 1cf5c979dd6cf51bd03d8f032d41ec2e75ae631e..0953bd185caf9df1e6298fb7d9f8f3849defd7bd 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ deploy: DB_deploy Tasker_deploy Tasker_run Tasker_install: Tasker_deploy - npm install -g gulp + @ Tasker_deploy: npm install diff --git a/db/Makefile b/db/Makefile index c3dec2ace328d6759b482bdffa1ba0e98b5c3f0d..28e2f45963de4d01d8f6033a2e1c5de1600d809d 100644 --- a/db/Makefile +++ b/db/Makefile @@ -3,13 +3,16 @@ $(subst .sql, , $(wildcard $1/*.sql)) endef -USER := $(shell bash -c 'read -p "Username: " pwd; echo $$username') +USER := $(shell bash -c 'read -p "Username: " username; echo $$username') PASS := $(shell bash -c 'read -s -p "Password: " pwd; echo $$pwd') DB := mmcs_rating +default: deploy + @ - -install: $(call GET_NAMES, structure) \ +install: \ +clear \ +$(call GET_NAMES, structure) \ $(call GET_NAMES, data) \ $(call GET_NAMES, constraints) \ deploy @@ -18,6 +21,10 @@ deploy deploy: $(call GET_NAMES, stored) @ +clear: + yes | mysqladmin -u $(USER) $(PASS) drop $(DB) || true + mysqladmin -u $(USER) $(PASS) create $(DB); + %: mysql -u $(USER) $(PASS) $(DB) < $@.sql diff --git a/gulpfile.js b/gulpfile.js index 791550e456cbcfd0ef082c4185d071eb2c309de1..6cc35efac8e4f8de574b98205008393d7f37f931 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,7 +144,7 @@ var constructTask = function (config) { lazypipe().pipe(changed, config.dst, ext) : empty; - gulp.src(config.src) + return gulp.src(config.src) .pipe(chgPipe()) .pipe(midPipe()) .on('error', errorHandler) @@ -165,19 +165,19 @@ var constructWatch = function (config) { gulp.task('less:compile', function () { - constructTask(getConfig('less')); + return constructTask(getConfig('less')); }); gulp.task('css:copy', function () { - constructTask(getConfig('css')); + return constructTask(getConfig('css')); }); gulp.task('js:copy', function () { - constructTask(getConfig('js')); + return constructTask(getConfig('js')); }); gulp.task('config:copy', function () { - constructTask({ + return constructTask({ src: paths.src.config, dst: paths.dst.config }); @@ -185,7 +185,7 @@ gulp.task('config:copy', function () { gulp.task('components:copy', function () { constructTask(getConfig('css_components')); - constructTask(getConfig('js_components')); + return constructTask(getConfig('js_components')); }); @@ -196,11 +196,18 @@ gulp.task('folders:create', function () { var dirs = [ app + '/logs/', + app + '/static/', app + '/static/components/' ]; - dirs.forEach(function (i) { - fs.mkdir(dirs[i]); + dirs.forEach(function (dir) { + try { + fs.mkdirSync(dir); + } catch (err) { + if (err.code !== 'EEXIST') { + throw err; + } + } }); }); diff --git a/package.json b/package.json index cb880ac7c0e32cb3b42f865398f618c9295ae509..c405bdd27e4ffa05c90a388a810d201efbbf6c7e 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { - "name": "gulp", - "version": "1.0.0", - "description": "", - "main": "gulpfile.js", - "dependencies": { + "name": "GradeRatingSystem", + "version": "0.0.0", + "dependencies": {}, + "devDependencies": { "gulp": "^3.9.0", "gulp-changed": "^1.2.1", "gulp-autoprefixer": "^2.3.1", @@ -15,11 +14,5 @@ "lazypipe": "^1.0.1", "gulp-uglify": "^1.2.0", "minimist": "^1.1.1" - }, - "devDependencies": {}, - "scripts": { - "test": "gulp" - }, - "author": "", - "license": "ISC" + } }