Skip to content

Commit

Permalink
remove publish-all / update-json and now use generate-post
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Nov 3, 2016
1 parent 362729f commit 6609a1b
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 287 deletions.
20 changes: 20 additions & 0 deletions docs/abe-generate-posts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generate posts

abe
Command:

`generate-posts`

Options:

`--path=` [ path to site/some/folder ]

`--destination=` [ path to some/folder ]

`--status=` [ draft / review / approve]

# cli

```shell
abe generate-posts --path=be --destination=publish --status=publish
```
9 changes: 0 additions & 9 deletions docs/abe-publish-all.md

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"compile": "./node_modules/.bin/babel --presets es2015,stage-0 -d dist/ src/ && cp -r src/cli/core/config/config.json dist/cli/core/config/config.json",
"watchdev": "npm run build:front && npm run compile && npm run mvasset && nodemon --debug --exec npm run compile && npm run mvasset --kill-others",
"startdev": "npm run build:front && npm run compile && npm run mvasset && node src/tasks/nodemon.js & npm run watch --kill-others",
"startdevOnly": "npm run js:admin && npm run js:engine && node src/tasks/nodemon.js & npm run watch --kill-others",
"build:folder": "node --harmony dist/cli/Builder.js"
"startdevOnly": "npm run js:admin && npm run js:engine && node src/tasks/nodemon.js & npm run watch --kill-others"
},
"author": "Adfab Connect",
"license": "ISC",
Expand Down
58 changes: 0 additions & 58 deletions src/cli/Builder.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/cli/process/generate-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function publishNext(files, tt, cb, i = 0) {
resolve()
},
() => {
error('publish-all ERROR on ' + pub[processConfig.ABE_STATUS].path.replace(config.root, '').replace(config.data.url, ''))
error('generate-posts ERROR on ' + pub[processConfig.ABE_STATUS].path.replace(config.root, '').replace(config.data.url, ''))
resolve()
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/cli/process/initAbeForProcesses.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function init(processName, conf) {
resolve()
})
.catch((e) => {
error('publish-all' + e)
error(processName + ' ' + e)
})
}else {
error('ABE_WEBSITE is not defined use node process.js ABE_WEBSITE=/pat/to/website')
Expand Down
148 changes: 0 additions & 148 deletions src/cli/process/publish-all.js

This file was deleted.

30 changes: 0 additions & 30 deletions src/cli/process/update-json.js

This file was deleted.

23 changes: 1 addition & 22 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ program
.option('-f, --folder <folder>', '--folder draft|sites')
.option('-t, --type <type>', '--type draft|other')
.option('-d, --destination <destination>', '--destination folder')
.option('generate-posts, --path=<folder> --destination=<folder> --status=<status>', 'save only <status> posts into <destination> from <path> folder')
.parse(process.argv)

var userArgs = process.argv.slice(2)
Expand Down Expand Up @@ -241,28 +242,6 @@ if(typeof userArgs[0] !== 'undefined' && userArgs[0] !== null){
process.exit(0)
})

break
case 'update-json':
dir = process.cwd()
if(process.env.ROOT) {
dir = process.env.ROOT.replace(/\/$/, '')
}

const updateJson = spawn('node', ['--harmony', __dirname + '/cli/cms/data/update-json.js', 'ABE_WEBSITE=' + dir])

updateJson.stdout.on('data', (data) => {
console.log(clc.cyan('stdout'), data.toString())
})

updateJson.stderr.on('data', (data) => {
console.log(clc.red('stderr'), data.toString())
})

updateJson.on('close', (code) => {
console.log(clc.cyan('child process exited with code'), code)
process.exit(0)
})

break
case 'install':
dir = process.cwd()
Expand Down
4 changes: 2 additions & 2 deletions src/server/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
,getPage
,postPage
,postPublish
,getRepublish
,getGeneratePost
,postReject
,postDraft
,getSaveConfig
Expand Down Expand Up @@ -38,7 +38,7 @@ router.post('/abe/sql-request*', postSqlRequest)
router.post('/abe/page/*', postPage)
router.get('/abe/page/*', getPage)
router.post('/abe/publish*', postPublish)
router.get('/abe/republish', getRepublish)
router.get('/abe/generate-posts', getGeneratePost)
router.post('/abe/reject*', postReject)
router.post('/abe/draft*', postDraft)
router.get('/abe/save-config', getSaveConfig)
Expand Down
Loading

0 comments on commit 6609a1b

Please sign in to comment.