diff --git a/packages/cli/src/CliSetup.ts b/packages/cli/src/CliSetup.ts index 49d0fab..f25d445 100644 --- a/packages/cli/src/CliSetup.ts +++ b/packages/cli/src/CliSetup.ts @@ -14,7 +14,8 @@ import { dryRunSuccessMessage, generateNetworkSuffix, parseKeypair, - showMessage + showMessage, + showNetworkWarningIfApplicable } from "./CliUtils.js"; import { LAMPORTS_PER_SOL } from "@solana/web3.js" import * as dotenv from "dotenv"; @@ -104,6 +105,7 @@ export const createPublisherCliCmd = createCliCmd .option("-p, --priority-fee-lamports ", "Priority Fee lamports") .action(async ({ keypair, url, dryRun, storageConfig, priorityFeeLamports }) => { await tryWithErrorMessage(async () => { + showNetworkWarningIfApplicable(url) latestReleaseMessage(); await checkForSelfUpdate(); @@ -141,6 +143,7 @@ export const createAppCliCmd = createCliCmd .option("-p, --priority-fee-lamports ", "Priority Fee lamports") .action(async ({ publisherMintAddress, keypair, url, dryRun, storageConfig, priorityFeeLamports }) => { await tryWithErrorMessage(async () => { + showNetworkWarningIfApplicable(url) latestReleaseMessage(); await checkForSelfUpdate(); @@ -194,6 +197,7 @@ export const createReleaseCliCmd = createCliCmd .option("-p, --priority-fee-lamports ", "Priority Fee lamports") .action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath, storageConfig, priorityFeeLamports }) => { await tryWithErrorMessage(async () => { + showNetworkWarningIfApplicable(url) latestReleaseMessage(); await checkForSelfUpdate(); diff --git a/packages/cli/src/CliUtils.ts b/packages/cli/src/CliUtils.ts index 7030d7e..12ff652 100644 --- a/packages/cli/src/CliUtils.ts +++ b/packages/cli/src/CliUtils.ts @@ -117,6 +117,14 @@ export const dryRunSuccessMessage = () => { showMessage("Dry run", "Dry run was successful", "standard") } +export const showNetworkWarningIfApplicable = (rpcUrl: string) => { + if (isDevnet(rpcUrl)) { + showMessage("Devnet Mode", "Running on Devnet", "warning") + } else if (isTestnet(rpcUrl)) { + showMessage("Testnet Mode", "Running on Testnet", "warning") + } +} + export const showMessage = ( titleMessage = "", contentMessage = "",