Skip to content

Commit

Permalink
Add outFile to Zip, delete zipPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
MilapNaik committed Mar 20, 2024
1 parent f64ab5d commit 4ffc8f7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/RokuDeploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ describe('index', () => {
});
});

describe('zipPackage', () => {
describe('zip', () => {
it('should throw error when manifest is missing', async () => {
let err;
try {
Expand Down
1 change: 1 addition & 0 deletions src/RokuDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ export interface StageOptions {
export interface ZipOptions {
stagingDir?: string;
outDir?: string;
outFile?: string;
}

export interface SideloadOptions {
Expand Down
7 changes: 0 additions & 7 deletions src/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
15 changes: 4 additions & 11 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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',
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 0 additions & 12 deletions src/commands/ZipPackageCommand.ts

This file was deleted.

0 comments on commit 4ffc8f7

Please sign in to comment.