Skip to content
Closed
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
6 changes: 3 additions & 3 deletions tokens/create-token/anchor/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/create-token/native/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/nft-operations/anchor/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/nft-operations/pinocchio/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ const outputDir = 'tests/fixtures';

try {
mkdirSync(outputDir, { recursive: true });
// Point the Solana CLI at mainnet, where the canonical program lives.
execSync('solana config set -um', { stdio: 'inherit' });

for (const { id, name } of programs) {
const outputFile = join(outputDir, name);
rmSync(outputFile, { force: true });
execSync(`solana program dump ${id} ${outputFile}`, { stdio: 'inherit' });
// `-um` points this one command at mainnet, where the canonical program
// lives, without touching the developer's global Solana CLI config.
execSync(`solana program dump -um ${id} ${outputFile}`, { stdio: 'inherit' });
console.log(`Dumped ${id} -> ${outputFile}`);
}
} catch (error) {
Expand Down
6 changes: 3 additions & 3 deletions tokens/pda-mint-authority/anchor/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/pda-mint-authority/native/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/transfer-tokens/anchor/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
6 changes: 3 additions & 3 deletions tokens/transfer-tokens/native/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
for (const program of programs) {
const { id, name } = program;
const outputFile = join(outputDir, name);
await $`solana config set -um`;

try {
await mkdir(outputDir, { recursive: true });
if (overwrite) await rm(outputFile, { force: true });
await $`solana program dump ${id} ${outputFile}`;
// `-um` targets mainnet for this command only, leaving the developer's
// global Solana CLI config alone.
await $`solana program dump -um ${id} ${outputFile}`;
console.log(`Program ${id} dumped to ${outputFile}`);
} catch (error) {
console.error(`Error dumping ${id}: ${error.message}`);
Expand Down
Loading