Skip to content

Commit

Permalink
publish-all not working
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Sep 13, 2016
1 parent 05aa247 commit 12bc14e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/cli/models/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export default class Page {
// HOOKS beforePageJson
json = Hooks.instance.trigger('beforePageJson', json)

if( typeof Handlebars.templates !== 'undefined' &&
Handlebars.templates !== null && typeof Handlebars.templates[templateId] !== 'undefined' &&
if(typeof Handlebars.templates[templateId] !== 'undefined' &&
Handlebars.templates[templateId] !== null &&
config.files.templates.precompile
){
Expand Down
23 changes: 11 additions & 12 deletions src/cli/process/publish-all.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
// ./node_modules/.bin/babel-node src/cli/process/publish-all.js ABE_WEBSITE=/path/to/website
// ./node_modules/.bin/babel-node src/cli/process/publish-all.js FILEPATH=/path/to/website/path/to/file.html ABE_WEBSITE=/path/to/website
import {
config
,FileParser
,fileUtils
,folderUtils
,save
,log
} from '../../cli'

var pConfig = {}
Array.prototype.forEach.call(process.argv, (item) => {
if (item.indexOf('=') > -1) {
Expand All @@ -23,12 +14,21 @@ if(typeof pConfig.ABE_PATH === 'undefined' || pConfig.ABE_PATH === null) {
pConfig.ABE_PATH = ''
}


// var logsPub = ""
if(typeof pConfig.ABE_WEBSITE !== 'undefined' && pConfig.ABE_WEBSITE !== null) {
var config = require('../../cli').config
if(pConfig.ABE_WEBSITE) config.set({root: pConfig.ABE_WEBSITE.replace(/\/$/, '') + '/'})
try {


var FileParser = require('../../cli').FileParser
var fileUtils = require('../../cli').fileUtils
var folderUtils = require('../../cli').folderUtils
var save = require('../../cli').save
var log = require('../../cli').log
var Manager = require('../../cli').Manager

Manager.instance;

// log.write('publish-all', '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *')
console.log('publish-all', '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *')
// log.write('publish-all', 'start process publish')
Expand Down Expand Up @@ -60,7 +60,6 @@ if(typeof pConfig.ABE_WEBSITE !== 'undefined' && pConfig.ABE_WEBSITE !== null) {
let publish = config.publish.url
var published = FileParser.getFilesByType(fileUtils.concatPath(site.path, publish, pConfig.ABE_PATH))
published = FileParser.getMetas(published, 'draft')

var ar_url = []
var promises = []
var i = 0
Expand Down

0 comments on commit 12bc14e

Please sign in to comment.