Skip to content

Commit

Permalink
add normalise paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Walker-GM committed Aug 18, 2024
1 parent 6529fe1 commit c3a14f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/framework-tools/src/attw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createRequire } from 'node:module'
import path from 'node:path'

import { $ } from 'zx'
$.verbose = true

interface Problem {
kind: string
Expand All @@ -21,13 +22,15 @@ export async function attw({ cwd }: Options): Promise<Problem[]> {
const pathToAttw = require.resolve('@arethetypeswrong/cli/package.json')
const attwPackageJson = require(pathToAttw)
const relativeBinPath = attwPackageJson.bin.attw
const attwBinPath = path.resolve(path.dirname(pathToAttw), relativeBinPath)
const attwBinPath = path.normalize(
path.resolve(path.dirname(pathToAttw), relativeBinPath),
)

// Run attw via it's CLI
await $({
nothrow: true,
cwd,
})`yarn node ${attwBinPath} -P -f json > .attw.json`
})`node ${attwBinPath} -P -f json > .attw.json`

// Read the resulting JSON file
const output = await $`cat .attw.json`
Expand Down

0 comments on commit c3a14f8

Please sign in to comment.