Skip to content

Synchronizes a Rust binary version with the related Rust crate

Notifications You must be signed in to change notification settings

metaplex-foundation/rustbin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustbin Build Lint and Test 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

About

Synchronizes a Rust binary version with the related Rust crate

Resources

Stars

Watchers

Forks

Packages

No packages published