Skip to content

Commit

Permalink
Revert "Print helpful error if try to use CLI commands outside of bli…
Browse files Browse the repository at this point in the history
…tz app (#203)" (#316)

This reverts commit e8f68a5.
  • Loading branch information
aem authored Apr 28, 2020
1 parent e8f68a5 commit 523ce93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 113 deletions.
7 changes: 1 addition & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-not-found"
],
"hooks": {
"prerun": [
"./src/checkBeforeRunning"
]
}
]
},
"keywords": [
"blitz",
Expand Down
37 changes: 0 additions & 37 deletions packages/cli/src/checkBeforeRunning.ts

This file was deleted.

7 changes: 7 additions & 0 deletions packages/cli/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ export default class Generate extends Command {
debug('args: ', args)
debug('flags: ', flags)

const isInRoot = fs.existsSync(path.resolve('blitz.config.js'))

if (!isInRoot) {
log.error('No blitz.config.js found. `generate` must be run from the root of the project.')
this.exit(1)
}

try {
let fileRoot: string
let singularRootContext: string
Expand Down
70 changes: 0 additions & 70 deletions packages/cli/src/utils/is-blitz-root.ts

This file was deleted.

0 comments on commit 523ce93

Please sign in to comment.