Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/services/functions/build/build.rust.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {checkCandidExtractor, checkIcWasm, checkWasi2ic} from '../../../utils/bu
import {readSatelliteDid} from '../../../utils/did.utils';
import {checkRustVersion} from '../../../utils/env.utils';
import {formatTime} from '../../../utils/format.utils';
import {isHeadless} from '../../../utils/process.utils';
import {readEmulatorConfigAndCreateDeployTargetDir} from '../../emulator/_fs.services';
import {generateApi, generateDid} from './build.did.services';
import {prepareJunoPkgForSatellite, prepareJunoPkgForSputnik} from './build.metadata.services';
Expand Down Expand Up @@ -54,7 +53,7 @@ export const buildRust = async ({
return;
}

const {valid: validBindgen} = await checkIcpBindgen({withGlobalFallback: isHeadless()});
const {valid: validBindgen} = await checkIcpBindgen();

if (!validBindgen) {
return;
Expand Down
19 changes: 4 additions & 15 deletions src/utils/build.bindgen.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import {checkToolInstalled} from './env.utils';
import {detectPackageManager} from './pm.utils';
import {confirmAndExit} from './prompt.utils';

export const checkIcpBindgen = async ({
withGlobalFallback
}: {
withGlobalFallback: boolean;
}): Promise<{valid: boolean}> => {
export const checkIcpBindgen = async (): Promise<{valid: boolean}> => {
const pm = detectPackageManager();

const {valid: localValid} = await checkLocalIcpBindgen({pm});
Expand All @@ -19,17 +15,10 @@ export const checkIcpBindgen = async ({
return {valid: true};
}

if (withGlobalFallback) {
const {valid: globalValid} = await checkGlobalIcpBindgen();

if (globalValid === true) {
return {valid: true};
}
const {valid: globalValid} = await checkGlobalIcpBindgen();

// Useful the day we require a specific version of the tool.
if (globalValid === false) {
return {valid: globalValid};
}
if (globalValid === true) {
return {valid: true};
}

// Useful the day we require a specific version of the tool.
Expand Down