This commit is contained in:
2017-08-02 13:10:30 +02:00
parent 3beff3320c
commit ef3ca28a66
8 changed files with 24 additions and 12 deletions

View File

@ -224,9 +224,14 @@ export let fileTreeToObject = async (dirPathArg: string, miniMatchFilter: string
let fileTree = await listFileTree(dirPath, miniMatchFilter)
let smartfileArray: Smartfile[] = []
for (let filePath of fileTree) {
let fileContentString = toStringSync(
plugins.path.join(dirPath, filePath)
)
let readPath = ((): string => {
if (!plugins.path.isAbsolute(filePath)) {
return plugins.path.join(dirPath, filePath)
} else {
return readPath
}
})()
let fileContentString = toStringSync(readPath)
// push a read file as Smartfile
smartfileArray.push(new Smartfile({