From b51c3fca126df59a239300a82f142b908d29a605 Mon Sep 17 00:00:00 2001 From: Milap Naik Date: Fri, 15 Mar 2024 01:22:01 -0400 Subject: [PATCH] Change publish to sideload everywhere else --- src/RokuDeploy.spec.ts | 2 +- src/RokuDeploy.ts | 2 +- src/cli.spec.ts | 4 ++-- src/cli.ts | 6 +++--- src/commands/{PublishCommand.ts => SideloadCommand.ts} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/commands/{PublishCommand.ts => SideloadCommand.ts} (87%) diff --git a/src/RokuDeploy.spec.ts b/src/RokuDeploy.spec.ts index 486f2d6..d8437b7 100644 --- a/src/RokuDeploy.spec.ts +++ b/src/RokuDeploy.spec.ts @@ -801,7 +801,7 @@ describe('index', () => { outFile: 'fileThatDoesNotExist.zip', deleteDevChannel: false }); - }, `Cannot publish because file does not exist at '${rokuDeploy['getOutputZipFilePath']({ + }, `Cannot sideload because file does not exist at '${rokuDeploy['getOutputZipFilePath']({ outFile: 'fileThatDoesNotExist.zip', outDir: outDir })}'`); diff --git a/src/RokuDeploy.ts b/src/RokuDeploy.ts index bc66be4..d2486d9 100644 --- a/src/RokuDeploy.ts +++ b/src/RokuDeploy.ts @@ -267,7 +267,7 @@ export class RokuDeploy { let readStream: ReadStream; try { if ((await fsExtra.pathExists(zipFilePath)) === false) { - throw new Error(`Cannot publish because file does not exist at '${zipFilePath}'`); + throw new Error(`Cannot sideload because file does not exist at '${zipFilePath}'`); } readStream = fsExtra.createReadStream(zipFilePath); //wait for the stream to open (no harm in doing this, and it helps solve an issue in the tests) diff --git a/src/cli.spec.ts b/src/cli.spec.ts index d63f8d0..1393600 100644 --- a/src/cli.spec.ts +++ b/src/cli.spec.ts @@ -4,7 +4,7 @@ import * as fsExtra from 'fs-extra'; import { expect } from 'chai'; import { createSandbox } from 'sinon'; import { rokuDeploy } from './index'; -import { PublishCommand } from './commands/PublishCommand'; +import { SideloadCommand } from './commands/SideloadCommand'; import { ConvertToSquashfsCommand } from './commands/ConvertToSquashfsCommand'; import { RekeyDeviceCommand } from './commands/RekeyDeviceCommand'; import { CreateSignedPackageCommand } from './commands/CreateSignedPackageCommand'; @@ -73,7 +73,7 @@ describe('cli', () => { }); }); - const command = new PublishCommand(); + const command = new SideloadCommand(); await command.run({ host: '1.2.3.4', password: '5536', diff --git a/src/cli.ts b/src/cli.ts index 15bca48..1dc489b 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -4,7 +4,7 @@ import { ExecCommand } from './commands/ExecCommand'; import { SendTextCommand } from './commands/SendTextCommand'; import { PrepublishCommand } from './commands/PrepublishCommand'; import { ZipPackageCommand } from './commands/ZipPackageCommand'; -import { PublishCommand } from './commands/PublishCommand'; +import { SideloadCommand } from './commands/SideloadCommand'; import { ConvertToSquashfsCommand } from './commands/ConvertToSquashfsCommand'; import { RekeyDeviceCommand } from './commands/RekeyDeviceCommand'; import { CreateSignedPackageCommand } from './commands/CreateSignedPackageCommand'; @@ -141,14 +141,14 @@ void yargs return new ZipPackageCommand().run(args); }) - .command('publish', 'Publish a pre-existing packaged zip file to a remote Roku', (builder) => { + .command('sideload', 'Sideload a pre-existing packaged zip file to a remote Roku', (builder) => { return builder .option('host', { type: 'string', description: 'The IP Address of the host Roku', demandOption: false }) .option('password', { type: 'string', description: 'The password of the host Roku', demandOption: false }) .option('outDir', { type: 'string', description: 'The output directory', demandOption: false }) .option('outFile', { type: 'string', description: 'The output file', demandOption: false }); }, (args: any) => { - return new PublishCommand().run(args); + return new SideloadCommand().run(args); }) .command(['squash', 'convertToSquashfs'], 'Convert a pre-existing packaged zip file to a squashfs file', (builder) => { diff --git a/src/commands/PublishCommand.ts b/src/commands/SideloadCommand.ts similarity index 87% rename from src/commands/PublishCommand.ts rename to src/commands/SideloadCommand.ts index e365b12..58c2434 100644 --- a/src/commands/PublishCommand.ts +++ b/src/commands/SideloadCommand.ts @@ -1,6 +1,6 @@ import { rokuDeploy, util } from '../index'; -export class PublishCommand { +export class SideloadCommand { async run(args) { let options = { ...util.getOptionsFromJson(args),