use global tsc when local tsc not found
This commit is contained in:
parent
d64d956388
commit
2b9c89822d
1 changed files with 7 additions and 7 deletions
|
@ -118,19 +118,19 @@ export default class WatchProject implements Disposable {
|
|||
let res = await workspace.findUp(['node_modules'])
|
||||
let root: string
|
||||
let cmd: string
|
||||
// let root: string
|
||||
if (!res) {
|
||||
if (executable('tsc')) {
|
||||
cmd = 'tsc'
|
||||
root = workspace.cwd
|
||||
}
|
||||
} else {
|
||||
if (res) {
|
||||
let file = path.join(path.dirname(res), 'node_modules/.bin/tsc')
|
||||
if (fs.existsSync(file)) {
|
||||
cmd = './node_modules/.bin/tsc'
|
||||
root = path.dirname(res)
|
||||
}
|
||||
}
|
||||
if (!cmd) {
|
||||
if (executable('tsc')) {
|
||||
cmd = 'tsc'
|
||||
root = workspace.cwd
|
||||
}
|
||||
}
|
||||
if (!cmd) {
|
||||
workspace.showMessage(`Local & global tsc not found`, 'error')
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue