diff --git a/src/RokuDeploy.spec.ts b/src/RokuDeploy.spec.ts index c460ec5..0b31958 100644 --- a/src/RokuDeploy.spec.ts +++ b/src/RokuDeploy.spec.ts @@ -606,7 +606,7 @@ describe('index', () => { }); }); - describe('zipPackage', () => { + describe('zip', () => { it('should throw error when manifest is missing', async () => { let err; try { diff --git a/src/RokuDeploy.ts b/src/RokuDeploy.ts index 6d8198a..f874550 100644 --- a/src/RokuDeploy.ts +++ b/src/RokuDeploy.ts @@ -983,6 +983,7 @@ export interface StageOptions { export interface ZipOptions { stagingDir?: string; outDir?: string; + outFile?: string; } export interface SideloadOptions { diff --git a/src/cli.spec.ts b/src/cli.spec.ts index 8c9ba59..c266068 100644 --- a/src/cli.spec.ts +++ b/src/cli.spec.ts @@ -59,13 +59,6 @@ describe('cli', () => { expectPathExists(`${stagingDir}/source/main.brs`); }); - it('Successfully uses zipPackage to create .zip', () => { - fsExtra.outputFileSync(`${stagingDir}/manifest`, ''); - - execSync(`node ${cwd}/dist/cli.js zipPackage --stagingDir ${stagingDir} --outDir ${outDir}`); - expectPathExists(`${outDir}/roku-deploy.zip`); - }); - it('Publish passes proper options', async () => { const stub = sinon.stub(rokuDeploy, 'sideload').callsFake(async () => { return Promise.resolve({ diff --git a/src/cli.ts b/src/cli.ts index e047847..dc78e02 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -3,7 +3,6 @@ import * as yargs from 'yargs'; import { ExecCommand } from './commands/ExecCommand'; import { SendTextCommand } from './commands/SendTextCommand'; import { StageCommand } from './commands/StageCommand'; -import { ZipPackageCommand } from './commands/ZipPackageCommand'; import { SideloadCommand } from './commands/SideloadCommand'; import { ConvertToSquashfsCommand } from './commands/ConvertToSquashfsCommand'; import { RekeyDeviceCommand } from './commands/RekeyDeviceCommand'; @@ -22,7 +21,8 @@ void yargs .command('bundle', 'execute build actions for bundling app', (builder) => { return builder .option('rootDir', { type: 'string', description: 'The selected root folder to be copied', demandOption: false }) - .option('outDir', { type: 'string', description: 'The output directory', 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 ExecCommand( 'stage|zip', @@ -152,14 +152,6 @@ void yargs return new StageCommand().run(args); }) - .command(['zip', 'zipPackage'], 'Given an already-populated staging folder, create a zip archive of it and copy it to the output folder', (builder) => { - return builder - .option('stagingDir', { type: 'string', description: 'The selected staging folder', demandOption: false }) - .option('outDir', { type: 'string', description: 'The output directory', demandOption: false }); - }, (args: any) => { - return new ZipPackageCommand().run(args); - }) - .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 }) @@ -233,7 +225,8 @@ void yargs .command('zip', 'Given a path to a folder, zip up that folder and all of its contents', (builder) => { return builder .option('stagingDir', { type: 'string', description: 'The folder that should be zipped', demandOption: false }) - .option('outDir', { type: 'string', description: 'The path to the zip that will be created. Must be .zip file name', demandOption: false }); + .option('outDir', { type: 'string', description: 'The path to the zip that will be created. Must be .zip file name', demandOption: false }) + .option('outFile', { type: 'string', description: 'The output file', demandOption: false }); }, (args: any) => { console.log('args', args); return new ZipCommand().run(args); diff --git a/src/commands/ZipPackageCommand.ts b/src/commands/ZipPackageCommand.ts deleted file mode 100644 index b1463e7..0000000 --- a/src/commands/ZipPackageCommand.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { rokuDeploy } from '../index'; -import { util } from '../util'; - -export class ZipPackageCommand { - async run(args) { - const options = { - ...util.getOptionsFromJson(), - ...args - }; - await rokuDeploy.zip(options); - } -}