cli: always use src/ version of cli inside repo

This commit is contained in:
Patrik Oldsberg
2020-03-06 12:06:06 +01:00
parent ea4810c32d
commit a707a79ef6
2 changed files with 16 additions and 2 deletions
+15 -1
View File
@@ -1,2 +1,16 @@
#!/usr/bin/env node
require('../cjs');
const path = require('path');
// Figure out whether we're running inside the backstage repo or as an installed dependency
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
if (!isLocal) {
require('../cjs');
} else {
require('ts-node').register({
project: path.resolve(__dirname, '../tsconfig.json'),
transpileOnly: true,
});
require('../src');
}