Commit 0cf9b9d

Anton Medvedev <anton@medv.io>
2021-05-23 18:55:00
Use npx to proxy call to tsc
1 parent 80affc9
Changed files (1)
zx.mjs
@@ -117,7 +117,7 @@ async function importPath(filepath, origin = filepath) {
   if (ext === '.ts') {
     let {dir, name} = parse(filepath)
     let outFile = join(dir, name + '.mjs')
-    await $`tsc --target esnext --module esnext --moduleResolution node ${filepath}`
+    await run`npx --yes tsc --target esnext --module esnext --moduleResolution node ${filepath}`
     await fs.rename(join(dir, name + '.js'), outFile)
     let wait = importPath(outFile, filepath)
     await fs.rm(outFile)
@@ -170,3 +170,11 @@ function transformMarkdown(source) {
   }
   return output.join('\n')
 }
+
+async function run(pieces, ...args) {
+  let v = $.verbose
+  $.verbose = false
+  let p = $(pieces, ...args)
+  $.verbose = v
+  return p
+}