Skip to content

Commit

Permalink
Formatting: don’t use an environment variable to communicate with top…
Browse files Browse the repository at this point in the history
…iary

Instead, use a command-line argument to pass the query file.
  • Loading branch information
rrthomas committed Sep 14, 2024
1 parent 6aaedc8 commit 4087d88
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ursa/fmt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ export function format(
},
},
}`)
process.env.TOPIARY_LANGUAGE_DIR = path.join(__dirname, '../../lib/topiary')
const queryFile = path.join(__dirname, '../../lib/topiary/ursa.scm')
const result = execaSync(
'topiary',
['format', '--language', 'ursa', '--configuration', tmpConfigFile.name],
['format', '--language', 'ursa', '--configuration', tmpConfigFile.name, '--query', queryFile],
{input: expr, stripFinalNewline: false},
)
tmpConfigFile.removeCallback()
delete process.env.TOPIARY_LANGUAGE_DIR
return result.stdout
}

0 comments on commit 4087d88

Please sign in to comment.