Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8262910
commit 08228ae
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import path from "node:path"; | ||
import fs from "node:fs"; | ||
import { execSync } from "node:child_process"; | ||
import { OptionValues, Command } from "commander"; | ||
|
||
export default function setup(opts: OptionValues, cmd: Command) { | ||
console.log("Setting up ..."); | ||
|
||
const dir = path.resolve(__dirname, "..", "env", "rs"); | ||
try { | ||
execSync("cargo build --release --bin agent", { | ||
cwd: dir, | ||
stdio: process.env.VERBOSE ? "inherit" : "ignore", | ||
}); | ||
fs.rmSync(path.resolve(dir, "target", "release", "agent")); | ||
} catch (err) { | ||
if (process.env.VERBOSE) { | ||
console.error( | ||
`Rust deps pre-build failed, but it should not be a problem: ${ | ||
(err as Error).message | ||
}`, | ||
); | ||
} | ||
} | ||
|
||
console.log("Setup complete."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters