Skip to content

Commit

Permalink
chore: resolve tsc output with process.cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
joris-gallot committed May 7, 2024
1 parent f19cf5c commit a34a89b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
import { existsSync } from 'node:fs'
import { readFile, writeFile } from 'node:fs/promises'
import { resolve } from 'node:path'
import process from 'node:process'
import { defineCommand } from 'citty'
import { parseTscOutput } from '../index.js'
import { writeTypestepConfig } from '../utils.js'
Expand Down Expand Up @@ -35,6 +37,6 @@ export default defineCommand({
if (existsSync(CONFIG_FILE_NAME))
throw new Error('Typestep config file already exists')

init(args.tsc_output_file)
init(resolve(process.cwd(), args.tsc_output_file))
},
})
4 changes: 2 additions & 2 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { existsSync } from 'node:fs'
import { readFile } from 'node:fs/promises'
import { resolve } from 'node:path'
import process from 'node:process'
import { defineCommand, runMain } from 'citty'
import { defineCommand } from 'citty'

import type { TypestepConfig } from '../types.js'
import { tryImport, tscDiagnosticToTscError } from '../utils.js'
Expand Down Expand Up @@ -61,6 +61,6 @@ export default defineCommand({
if (!existsSync(args.tsc_output_file))
throw new Error('Tsc output file not found')

run(args.tsc_output_file)
run(resolve(process.cwd(), args.tsc_output_file))
},
})

0 comments on commit a34a89b

Please sign in to comment.