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 res = await workspace.findUp(['node_modules'])
|
||||||
let root: string
|
let root: string
|
||||||
let cmd: string
|
let cmd: string
|
||||||
// let root: string
|
if (res) {
|
||||||
if (!res) {
|
|
||||||
if (executable('tsc')) {
|
|
||||||
cmd = 'tsc'
|
|
||||||
root = workspace.cwd
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let file = path.join(path.dirname(res), 'node_modules/.bin/tsc')
|
let file = path.join(path.dirname(res), 'node_modules/.bin/tsc')
|
||||||
if (fs.existsSync(file)) {
|
if (fs.existsSync(file)) {
|
||||||
cmd = './node_modules/.bin/tsc'
|
cmd = './node_modules/.bin/tsc'
|
||||||
root = path.dirname(res)
|
root = path.dirname(res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!cmd) {
|
||||||
|
if (executable('tsc')) {
|
||||||
|
cmd = 'tsc'
|
||||||
|
root = workspace.cwd
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
workspace.showMessage(`Local & global tsc not found`, 'error')
|
workspace.showMessage(`Local & global tsc not found`, 'error')
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue