Skip to content

Commit

Permalink
fix(docz-core): re-sync .docz on build
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Nov 29, 2019
1 parent 68c13e1 commit dfd4262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
12 changes: 4 additions & 8 deletions core/docz-core/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ import * as logger from 'signale'

import { parseConfig } from '../config/docz'
import { bundler as gatsby } from '../bundler'
import { getIsFirstInstall } from '../bundler/machine/actions'
import { init } from './init'
import { copyDoczRc } from '../bundler/machine/services/create-resources'

export const build = async (args: Arguments<any>) => {
copyDoczRc(args.config)
const config = await parseConfig(args)
const bundler = gatsby(config)
const isFirstInstall = getIsFirstInstall()

if (isFirstInstall) {
try {
await init(args)
} catch (err) {
throw new Error(`Failed to initialize docz : ${err.message}`)
}
try {
await init(args)
} catch (err) {
logger.error(`Failed to initialize docz : ${err.message}`)
}

try {
Expand Down
7 changes: 0 additions & 7 deletions core/docz-core/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,4 @@ export const init = async (args: Arguments<any>) => {
doczrcFilepath,
}
await createResources(serverMachineContext)
console.log()
console.log(`✅ Docz is ready to go `)
console.log()
console.log(`💻 yarn docz dev`)
console.log(`⛏ yarn docz build`)
console.log(`👀 yarn docz serve`)
console.log()
}

0 comments on commit dfd4262

Please sign in to comment.