Synchronizes a Rust binary version with the related Rust crate.
const path = require('path');
const rootDir = path.join(__dirname, 'cargo');
const cargoToml = path.join(__dirname, '..', '..', 'program', 'Cargo.toml');
const config = {
rootDir,
binaryName: 'anchor',
binaryCrateName: 'anchor-cli',
libName: 'anchor-lang',
dryRun: false,
cargoToml,
};
const { rustbinCheck } = require('@metaplex-foundation/rustbin');
const { satisfies, libVersion, binVersion } = await rustbinCheck({
console.log(`${binVersion} %s ${libVersion}`, satisfies ? 'satisfies' : 'does not satisfy');
const { rustbinMatch, confirmAutoMessageConsole } = require('@metaplex-foundation/rustbin');
const { cmd, fullPathToBinary } = await rustbinMatch(config, confirmAutoMessageConsole);
console.log(`${fullPathToBinary} installed via ${cmd}`);
Please consult the full API here.
Apache-2.0