Skip to content

Commit

Permalink
split structure/template (if one is not create both are empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Sep 16, 2016
1 parent 75171f7 commit 800fc12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -37,7 +37,7 @@
"ajax-request": "^1.2.1",
"babel-preset-es2015": "^6.9.0",
"body-parser": "^1.14.1",
"child-process-promise": "^2.0.1",
"child-process-promise": "^2.1.3",
"cli-color": "^1.1.0",
"cli-table": "^0.3.1",
"commander": "^2.9.0",
Expand Down
8 changes: 5 additions & 3 deletions src/cli/helpers/file-parser.js
Expand Up @@ -196,9 +196,11 @@ export default class FileParser {
let structure = config.structure.url
let templates = config.templates.url

if(folderUtils.isFolder(path.join(site.path, structure)) && folderUtils.isFolder(path.join(site.path, templates))) {
site.folders = FileParser.getFolders(path.join(site.path, structure), false)
result.structure = site.folders
if(folderUtils.isFolder(path.join(site.path, structure))) {
site.folders = FileParser.getFolders(path.join(site.path, structure), false)
result.structure = site.folders
}
if(folderUtils.isFolder(path.join(site.path, templates))) {
result.templates = result.templates.concat(FileParser.getFiles(path.join(site.path, templates), true, 10, new RegExp(`.${config.files.templates.extension}`)))
}

Expand Down

0 comments on commit 800fc12

Please sign in to comment.