Skip to content

Commit

Permalink
fix($core): try to fix windows output path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Oct 7, 2018
1 parent 113a1dd commit f62cd73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/@vuepress/core/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
}

const { outDir } = options
if (path.resolve() === outDir) {
if (process.cwd() === outDir) {
return console.error(logger.error(chalk.red('Unexpected option: outDir cannot be set to the current working directory.\n'), false))
}
await fs.remove(outDir)
logger.debug('Dist directory: ' + chalk.gray(path.resolve(outDir)))
logger.debug('Dist directory: ' + chalk.gray(path.resolve(process.cwd(), outDir)))

let clientConfig = createClientConfig(options, cliOptions).toConfig()
let serverConfig = createServerConfig(options, cliOptions).toConfig()
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/core/lib/prepare/AppContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = class AppContext {
this.base = this.siteConfig.base || '/'
this.themeConfig = this.siteConfig.themeConfig || {}
this.outDir = this.siteConfig.dest
? path.resolve(this.siteConfig.dest)
? path.resolve(process.cwd(), this.siteConfig.dest)
: path.resolve(sourceDir, '.vuepress/dist')

this.pluginAPI = new PluginAPI(this)
Expand Down

0 comments on commit f62cd73

Please sign in to comment.