Browse Source

moved scripts to bin/, added gulp tasks

Bachir Soussi Chiadmi 7 years ago
parent
commit
b68f53c0b0
7 changed files with 51 additions and 4 deletions
  1. 2 2
      assets/css/styles.scss
  2. 0 0
      bin/build.py
  3. 0 0
      bin/install.sh
  4. 0 0
      bin/oeuvres-gen.py
  5. 2 2
      bin/sync.sh
  6. 25 0
      gulpfile.js
  7. 22 0
      package.json

+ 2 - 2
assets/css/styles.scss

@@ -1,4 +1,4 @@
-@import "scss/setup.scss";
+@import "setup.scss";
 
 /**
  * Computation
@@ -242,4 +242,4 @@ p {
   }
 }
 
-@import "scss/custom.scss";
+@import "custom.scss";

+ 0 - 0
build.py → bin/build.py


+ 0 - 0
install.sh → bin/install.sh


+ 0 - 0
bin/oeuvres-gen.py


+ 2 - 2
sync.sh → bin/sync.sh

@@ -24,11 +24,11 @@ do
   if [ -d $folder/$repo.git ];
   then
     # if repos exists, pull
-    echo 'Pull $repo'
+    echo "Pull $repo"
     git -C $folder/$repo.git pull origin master
   else
     # if repos does not exists, clone
-    echo 'clone $repo'
+    echo "clone $repo"
     git clone $host/$repo.git $folder/$repo.git
   fi
 done

+ 25 - 0
gulpfile.js

@@ -0,0 +1,25 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrap = require('gulp-wrap');
+var sass = require('gulp-sass');
+var rename = require('gulp-rename');
+var shell = require('gulp-shell')
+var watch = require('gulp-watch');
+
+gulp.task('scss', function () {
+  gulp.src('./assets/css/styles.scss')
+    .pipe(sass().on('error', sass.logError))
+    .pipe(wrap('<style type="text/css">\n<%= contents %>\n</style>'))
+    .pipe(gulp.dest('./assets/css/dist'));
+});
+
+gulp.task('build', shell.task([
+  './bin/build.py'
+]));
+
+// default gulp task
+gulp.task('default', ['scss'], function() {
+  gulp.watch('./assets/css/**/*.scss', ['scss']);
+  gulp.watch(['bin/build.py', './assets/css/**/*.scss', './assets/js/**/*.js', './templates/*.tpl.html'], ['build']);
+});

+ 22 - 0
package.json

@@ -0,0 +1,22 @@
+{
+  "name": "TDSM",
+  "version": "1.0.0",
+  "description": "html2print TDSM",
+  "main": "gulpfile.js",
+  "repository": {
+    "type": "git",
+    "url": ""
+  },
+  "author": "Bachir Soussi Chiadmi",
+  "license": "MIT",
+  "homepage": "",
+  "devDependencies": {
+    "gulp": "",
+    "gulp-rename": "^1.2.2",
+    "gulp-sass": "^2.0.1",
+    "gulp-shell": "^0.5.2",
+    "gulp-watch": "^4.2.4",
+    "gulp-wrap": "^0.11.0"
+  },
+  "dependencies": {}
+}