| |
await Fs.readFile(`${supportDir}/heartwood-version`, "utf8")
|
| |
).substring(0, 7);
|
| |
|
| - |
process.env.PATH = [
|
| - |
Path.join(tmpDir, "bin", heartwoodShortSha),
|
| - |
process.env.PATH,
|
| - |
].join(Path.delimiter);
|
| + |
const binaryPath = Path.join(tmpDir, "bin", heartwoodShortSha);
|
| + |
process.env.PATH = [binaryPath, process.env.PATH].join(Path.delimiter);
|
| |
|
| |
// Assert that the `rad` CLI is installed and has the correct version.
|
| |
export async function assertRadInstalled(): Promise<void> {
|
| + |
const { stdout: which } = await execa("which", ["rad"]);
|
| + |
if (Path.dirname(which) !== binaryPath) {
|
| + |
throw new Error(
|
| + |
`rad path doesn't match used rad binary: ${binaryPath} !== ${which}`,
|
| + |
);
|
| + |
}
|
| |
const { stdout: version } = await execa("rad", ["--version"]);
|
| |
if (!version.includes(heartwoodShortSha)) {
|
| |
throw new Error(
|