Skip to content

Commit

Permalink
fix: set project path for single CLIs
Browse files Browse the repository at this point in the history
Fixes oclif#161
  • Loading branch information
jdx committed Aug 29, 2018
1 parent fe27985 commit 37520cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 0 additions & 9 deletions templates/single/bin/run

This file was deleted.

7 changes: 5 additions & 2 deletions templates/single/bin/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

const fs = require('fs')
const path = require('path')
const dev = fs.existsSync(path.join(__dirname, '../tsconfig.json'))
const project = path.join(__dirname, '../tsconfig.json')
const dev = fs.existsSync(project)

if (dev) require('ts-node/register')
if (dev) {
require('ts-node').register({project})
}

require(`../${dev ? 'src' : 'lib'}`).run()
.catch(require('@oclif/errors/handle'))

0 comments on commit 37520cc

Please sign in to comment.