|
@@ -1,25 +1,12 @@
|
|
|
const fs = require('fs');
|
|
const fs = require('fs');
|
|
|
const path = require('path');
|
|
const path = require('path');
|
|
|
-const { exec } = require('child_process');
|
|
|
|
|
const Promise = require('bluebird');
|
|
const Promise = require('bluebird');
|
|
|
|
|
+const execAsync = require('../lib/execAsync');
|
|
|
const examplesDir = path.normalize(__dirname + '/../exemples/jquery');
|
|
const examplesDir = path.normalize(__dirname + '/../exemples/jquery');
|
|
|
// const listJson = require('../exemples/liste.json');
|
|
// const listJson = require('../exemples/liste.json');
|
|
|
const beautify = require("json-beautify");
|
|
const beautify = require("json-beautify");
|
|
|
Promise.promisifyAll(fs);
|
|
Promise.promisifyAll(fs);
|
|
|
|
|
|
|
|
-// Promisified exec
|
|
|
|
|
-function execAsync(cmd) {
|
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
|
- exec(cmd, (error, stdout, stderr) => {
|
|
|
|
|
- if (error) {
|
|
|
|
|
- return reject(error);
|
|
|
|
|
- }
|
|
|
|
|
- resolve({ stdout, stderr });
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// Promisified exec of git mv src dst
|
|
// Promisified exec of git mv src dst
|
|
|
function gitMvAsync(src, dst) {
|
|
function gitMvAsync(src, dst) {
|
|
|
var cmd = 'git mv ' + src + ' ' + dst;
|
|
var cmd = 'git mv ' + src + ' ' + dst;
|