diff --git a/src/commands/rename_drive.ts b/src/commands/rename_drive.ts index 5e29ad87..ebdcb6cd 100644 --- a/src/commands/rename_drive.ts +++ b/src/commands/rename_drive.ts @@ -4,12 +4,14 @@ import { DryRunParameter, DriveIdParameter, DrivePrivacyParameters, - DriveNameParameter + DriveNameParameter, + GatewayParameter } from '../parameter_declarations'; import { cliArDriveFactory } from '..'; import { SUCCESS_EXIT_CODE } from '../CLICommand/error_codes'; import { CLIAction } from '../CLICommand/action'; import { EID, Wallet } from 'ardrive-core-js'; +import { getArweaveFromURL } from '../utils/get_arweave_for_url'; new CLICommand({ name: 'rename-drive', @@ -18,10 +20,12 @@ new CLICommand({ { name: DriveNameParameter, description: 'the new name for the drive' }, BoostParameter, DryRunParameter, - ...DrivePrivacyParameters + ...DrivePrivacyParameters, + GatewayParameter ], action: new CLIAction(async function action(options) { const parameters = new ParametersHelper(options); + const arweave = getArweaveFromURL(parameters.getGateway()); const dryRun = parameters.isDryRun(); const driveId = parameters.getRequiredParameterValue(DriveIdParameter, EID); @@ -31,7 +35,8 @@ new CLICommand({ const ardrive = cliArDriveFactory({ wallet, feeMultiple: parameters.getOptionalBoostSetting(), - dryRun + dryRun, + arweave }); const result = await (async function () { diff --git a/src/commands/rename_file.ts b/src/commands/rename_file.ts index eb9e4e15..580483b7 100644 --- a/src/commands/rename_file.ts +++ b/src/commands/rename_file.ts @@ -4,18 +4,28 @@ import { DryRunParameter, FileIdParameter, DrivePrivacyParameters, - FileNameParameter + FileNameParameter, + GatewayParameter } from '../parameter_declarations'; import { cliArDriveFactory } from '..'; import { SUCCESS_EXIT_CODE } from '../CLICommand/error_codes'; import { CLIAction } from '../CLICommand/action'; import { EID, Wallet } from 'ardrive-core-js'; +import { getArweaveFromURL } from '../utils/get_arweave_for_url'; new CLICommand({ name: 'rename-file', - parameters: [FileIdParameter, FileNameParameter, BoostParameter, DryRunParameter, ...DrivePrivacyParameters], + parameters: [ + FileIdParameter, + FileNameParameter, + BoostParameter, + DryRunParameter, + ...DrivePrivacyParameters, + GatewayParameter + ], action: new CLIAction(async function action(options) { const parameters = new ParametersHelper(options); + const arweave = getArweaveFromURL(parameters.getGateway()); const dryRun = parameters.isDryRun(); const fileId = parameters.getRequiredParameterValue(FileIdParameter, EID); @@ -25,7 +35,8 @@ new CLICommand({ const ardrive = cliArDriveFactory({ wallet: wallet, feeMultiple: parameters.getOptionalBoostSetting(), - dryRun + dryRun, + arweave }); const result = await (async function () { diff --git a/src/commands/rename_folder.ts b/src/commands/rename_folder.ts index 0f029c2b..f7cdbe4b 100644 --- a/src/commands/rename_folder.ts +++ b/src/commands/rename_folder.ts @@ -4,19 +4,30 @@ import { DryRunParameter, FolderIdParameter, DrivePrivacyParameters, - FolderNameParameter + FolderNameParameter, + GatewayParameter } from '../parameter_declarations'; import { cliArDriveFactory } from '..'; import { SUCCESS_EXIT_CODE } from '../CLICommand/error_codes'; import { CLIAction } from '../CLICommand/action'; import { EID, Wallet } from 'ardrive-core-js'; +import { getArweaveFromURL } from '../utils/get_arweave_for_url'; new CLICommand({ name: 'rename-folder', - parameters: [FolderIdParameter, FolderNameParameter, BoostParameter, DryRunParameter, ...DrivePrivacyParameters], + parameters: [ + FolderIdParameter, + FolderNameParameter, + BoostParameter, + DryRunParameter, + ...DrivePrivacyParameters, + GatewayParameter + ], action: new CLIAction(async function action(options) { const parameters = new ParametersHelper(options); + const arweave = getArweaveFromURL(parameters.getGateway()); + const dryRun = parameters.isDryRun(); const folderId = parameters.getRequiredParameterValue(FolderIdParameter, EID); const newName = parameters.getRequiredParameterValue(FolderNameParameter); @@ -25,7 +36,8 @@ new CLICommand({ const ardrive = cliArDriveFactory({ wallet: wallet, feeMultiple: parameters.getOptionalBoostSetting(), - dryRun + dryRun, + arweave }); const result = await (async function () {