2 const fs = require('fs') |
2 const fs = require('fs') |
3 const path = require('path') |
3 const path = require('path') |
4 const ncp = require('ncp').ncp |
4 const ncp = require('ncp').ncp |
5 ncp.limit = 16; |
5 ncp.limit = 16; |
6 const rimraf = require('rimraf') |
6 const rimraf = require('rimraf') |
|
7 var mkdirp = require('mkdirp'); |
7 const srcJsPath = path.dirname(__dirname) |
8 const srcJsPath = path.dirname(__dirname) |
8 const iconolabSrcPath = path.join(srcJsPath,"..","src") |
9 const iconolabSrcPath = path.join(srcJsPath,"..","src") |
9 const destJsDir = path.join(iconolabSrcPath, "iconolab", "static","iconolab", "js") |
10 const destJsDir = path.join(iconolabSrcPath, "iconolab", "static","iconolab", "js") |
10 const destCssDir = path.join(iconolabSrcPath,"iconolab", "static","iconolab", "css") |
11 const destCssDir = path.join(iconolabSrcPath,"iconolab", "static","iconolab", "css") |
11 |
12 |
50 path.join(srcJsPath, "iconolab-bundle", "dist", "build.js"), |
51 path.join(srcJsPath, "iconolab-bundle", "dist", "build.js"), |
51 path.join(destJsDir, "build.js") |
52 path.join(destJsDir, "build.js") |
52 ) |
53 ) |
53 |
54 |
54 |
55 |
55 const bootstrapPath = path.join(srcJsPath, "iconolab-bundle", "node_modules", "bootstrap", "dist", "css", "bootstrap.min.css"); |
56 const bootstrapPath = path.join(srcJsPath, "iconolab-bundle", "node_modules", "bootstrap"); |
56 const fontAwesomeCssPath = path.join(srcJsPath, "iconolab-bundle", "node_modules", "font-awesome","css","font-awesome.min.css"); |
57 const fontAwesomeCssPath = path.join(srcJsPath, "iconolab-bundle", "node_modules", "font-awesome","css","font-awesome.min.css"); |
57 const fontAwesomeDir = path.join(srcJsPath, "iconolab-bundle", "node_modules", "font-awesome"); |
58 const fontAwesomeDir = path.join(srcJsPath, "iconolab-bundle", "node_modules", "font-awesome"); |
58 |
59 |
59 copyFile(bootstrapPath, path.join(destCssDir, "bootstrap.min.css")); |
60 //copyFile(bootstrapPath, path.join(destCssDir, "bootstrap.min.css")); |
|
61 |
|
62 |
|
63 |
|
64 /* boostrap: we copy the dist folder*/ |
|
65 rimraf(path.join(destCssDir, 'bootstrap'), function () { |
|
66 ncp(path.join(bootstrapPath, "dist"), path.join(destCssDir, "bootstrap"), function (e) { |
|
67 if (e) { |
|
68 console.log(e); |
|
69 console.log("Erreur pendant la copie de boostrap vers le dossier dist"); |
|
70 } |
|
71 }); |
|
72 }); |
60 |
73 |
61 |
74 |
62 /* delete font-awesome folder */ |
75 /* delete font-awesome folder */ |
63 rimraf(path.join(destCssDir,'font-awesome'), function (e) { |
76 rimraf(path.join(destCssDir,'font-awesome'), function (e) { |
64 fs.access(path.join(destCssDir,'font-awesome'), fs.F_OK, function (hasError) { |
77 fs.access(path.join(destCssDir,'font-awesome'), fs.F_OK, function (hasError) { |