Skip to content

Commit

Permalink
fix: use cwd path for tsc. (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
knightedcodemonkey committed Jul 28, 2023
1 parent 4b50b8d commit dbf5227
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knighted/duel",
"version": "1.0.0-alpha.0",
"version": "1.0.0-alpha.1",
"description": "TypeScript dual packages.",
"type": "module",
"main": "dist",
Expand Down
11 changes: 4 additions & 7 deletions src/duel.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env node

import { argv } from 'node:process'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'node:path'
import { argv, cwd } from 'node:process'
import { join } from 'node:path'
import { spawnSync } from 'node:child_process'
import { writeFile, rm } from 'node:fs/promises'
import { randomBytes } from 'node:crypto'
Expand All @@ -14,10 +13,8 @@ import { specifier } from '@knighted/specifier'
import { init } from './init.js'
import { getRealPathAsFileUrl, logError, log } from './util.js'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const root = join(__dirname, '..')
const tsc = join(root, 'node_modules', '.bin', 'tsc')
// TypeScript is defined as a peer dependency.
const tsc = join(cwd(), 'node_modules', '.bin', 'tsc')
const runBuild = project => {
const { status, error } = spawnSync(tsc, ['-p', project], { stdio: 'inherit' })

Expand Down

0 comments on commit dbf5227

Please sign in to comment.