Skip to content

Commit

Permalink
fix(docz-core): add error when dest is working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jul 19, 2018
1 parent 67b6f00 commit b1c87b5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/docz-core/src/Bundler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as path from 'path'
import logger from 'signale'

import { Plugin } from './Plugin'

import { Config as Args, Env } from './commands/args'
Expand Down Expand Up @@ -74,6 +77,16 @@ export class Bundler<C = ConfigObj> {

public async build(config: C): Promise<void> {
const dist = paths.getDist(this.args.dest)

if (paths.root === path.resolve(dist)) {
logger.fatal(
new Error(
'Unexpected option: "dest" cannot be set to the current working directory.'
)
)
process.exit(1)
}

await this.builder(config, dist)
}

Expand Down

0 comments on commit b1c87b5

Please sign in to comment.