From 1f79f79ccf18e3766d9628accfb09d23d1f91d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Torres?= <30977845+Torres-ssf@users.noreply.github.com> Date: Thu, 9 Feb 2023 02:49:17 -0300 Subject: [PATCH] fix: forc bin path on typegen test utility (#772) --- .changeset/three-dolphins-cheer.md | 2 ++ .../abi-typegen/test/utils/sway/createTempSwayProject.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/three-dolphins-cheer.md diff --git a/.changeset/three-dolphins-cheer.md b/.changeset/three-dolphins-cheer.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/three-dolphins-cheer.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/abi-typegen/test/utils/sway/createTempSwayProject.ts b/packages/abi-typegen/test/utils/sway/createTempSwayProject.ts index 7b662c86d42..ddde6d123bb 100644 --- a/packages/abi-typegen/test/utils/sway/createTempSwayProject.ts +++ b/packages/abi-typegen/test/utils/sway/createTempSwayProject.ts @@ -3,7 +3,7 @@ import { execSync } from 'child_process'; import { copyFileSync, writeFileSync } from 'fs'; import mkdirp from 'mkdirp'; import os from 'os'; -import { basename, join } from 'path'; +import { basename, join, resolve } from 'path'; import rimraf from 'rimraf'; import { normalizeName } from '../../../src/utils/normalize'; @@ -56,8 +56,10 @@ export function createTempSwayProject(params: ISwayParams) { if (autoBuild === true) { // run forc build inside of it + const forcPath = join(__dirname, '..', '..', '..', '..', 'forc-bin', 'forc-binaries', 'forc'); + const absoluteForcPath = resolve(forcPath); try { - execSync(`pnpm exec forc build`, { + execSync(`${absoluteForcPath} build`, { cwd: tempDir, stdio: 'pipe', encoding: 'utf-8',