system change

This commit is contained in:
2018-03-03 13:57:55 +01:00
parent 48a9affa47
commit 96a5142409
4 changed files with 44 additions and 46 deletions

View File

@@ -1,35 +1,39 @@
// this file contains the implementation of the standard gulp api
import * as plugins from './smartgulp.plugins'
import { GulpStream } from './smartgulp.classes.gulpstream'
import { Transform } from 'stream'
import * as plugins from './smartgulp.plugins';
import { GulpStream } from './smartgulp.classes.gulpstream';
import { Transform } from 'stream';
import { Smartfile } from 'smartfile'
import { Smartfile } from 'smartfile';
export let src = (minimatchPathArrayArg: string[]): Transform => {
let gulpStream = new GulpStream()
let gulpStream = new GulpStream();
let handleFiles = async () => {
let smartfileArray: Smartfile[] = []
let smartfileArray: Smartfile[] = [];
for (let minimatchPath of minimatchPathArrayArg) {
let localSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(process.cwd(), minimatchPath)
smartfileArray = plugins.lodash.concat(smartfileArray, localSmartfileArray)
let localSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(
process.cwd(),
minimatchPath
);
smartfileArray = plugins.lodash.concat(smartfileArray, localSmartfileArray);
}
gulpStream.pipeSmartfileArray(smartfileArray)
}
gulpStream.pipeSmartfileArray(smartfileArray);
};
handleFiles().catch(err => {
console.log(err)
})
return gulpStream.stream
}
console.log(err);
});
return gulpStream.stream;
};
export let dest = (dirArg: string) => {
}
export let dest = (dirArg: string) => {};
export let replace = () => {
return plugins.through2.obj(async (file: Smartfile, enc, cb) => {
await file.write()
cb(null, file)
}, (cb) => {
cb()
})
}
return plugins.through2.obj(
async (file: Smartfile, enc, cb) => {
await file.write();
cb(null, file);
},
cb => {
cb();
}
);
};