Skip to content

Commit

Permalink
use pwd to get working director
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Aug 28, 2024
1 parent 0cb78eb commit c837f55
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions circuits/test/json/extractor/extractor.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { circomkit, WitnessTester, readInputFile } from "../../common";
import { join } from "path";
import { join, dirname } from "path";
import { spawn } from "child_process";


function executeCodegen(inputFilename: string, outputFilename: string) {
return new Promise((resolve, reject) => {
const inputPath = join(__dirname, "..", "..", "..", "..", "examples", "json", "test", "codegen", inputFilename);
let rootDir = "";
const pwd = spawn("pwd");
pwd.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
rootDir = data;
});

const inputPath = join(rootDir, "examples", "json", "test", "codegen", inputFilename);
const codegen = spawn("cargo", ["run", "--bin", "codegen", "--", "--json-file", inputPath, "--output-filename", outputFilename]);

codegen.stdout.on('data', (data) => {
Expand Down

0 comments on commit c837f55

Please sign in to comment.