@metaplex-foundation/rustbin
v0.3.5
Published
Synchronizes a Rust binary version with the related Rust crate
Downloads
41,914
Readme
rustbin
Synchronizes a Rust binary version with the related Rust crate.
Anchor Example
Prepare Config
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,
};
Checking Versions
const { rustbinCheck } = require('@metaplex-foundation/rustbin');
const { satisfies, libVersion, binVersion } = await rustbinCheck({
console.log(`${binVersion} %s ${libVersion}`, satisfies ? 'satisfies' : 'does not satisfy');
Check and Install If Needed
const { rustbinMatch, confirmAutoMessageConsole } = require('@metaplex-foundation/rustbin');
const { cmd, fullPathToBinary } = await rustbinMatch(config, confirmAutoMessageConsole);
console.log(`${fullPathToBinary} installed via ${cmd}`);
API
Please consult the full API here.
LICENSE
Apache-2.0