Skip to content

Commit

Permalink
remove the need to specify debug env when creating test projects
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 8, 2018
1 parent e8638ef commit 1d25147
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ cd packages/@vue/cli
yarn link

# create test projects in /packages/test
export VUE_CLI_DEBUG=true # necessary for manual tests to work
cd -
cd packages/test
vue create test-app
Expand Down
8 changes: 8 additions & 0 deletions packages/@vue/cli/bin/vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const semver = require('semver')
const { error } = require('@vue/cli-shared-utils')
Expand All @@ -13,6 +15,12 @@ if (!semver.satisfies(process.version, requiredVersion)) {
process.exit(1)
}

// enter debug mode when creating test repo
if (process.cwd().indexOf('/packages/test') > 0 &&
fs.existsSync(path.resolve(process.cwd(), '../@vue'))) {
process.env.VUE_CLI_DEBUG = true
}

const program = require('commander')
const loadCommand = require('../lib/util/loadCommand')

Expand Down

0 comments on commit 1d25147

Please sign in to comment.