Skip to content

Commit

Permalink
Returning assets for programatically called functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Vedder committed May 20, 2022
1 parent 339c871 commit 1a18adf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import mkdirp from 'mkdirp';
import log from '../logger';
import { isDirectory } from '../utils';
import { setupContext } from '../context/index';
import { Config } from '../types';
import { Config, Assets } from '../types';
import { ExportParams } from '../args';

export default async function exportCMD(params: ExportParams) {
export default async function exportCMD(params: ExportParams): Promise<Assets> {
const {
output_folder: outputFolder,
base_path: basePath,
Expand Down Expand Up @@ -59,5 +59,7 @@ export default async function exportCMD(params: ExportParams) {
// Setup context and load
const context = await setupContext(nconf.get());
await context.dump();

log.info('Export Successful');
return context.assets;
}
5 changes: 4 additions & 1 deletion src/commands/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { deploy as toolsDeploy } from '../tools';
import log from '../logger';
import { setupContext } from '../context';
import { ImportParams } from '../args';
import { Assets } from '../types';

export default async function importCMD(params: ImportParams) {
export default async function importCMD(params: ImportParams): Promise<Assets> {
const {
input_file: inputFile,
base_path: basePath,
Expand Down Expand Up @@ -52,4 +53,6 @@ export default async function importCMD(params: ImportParams) {
await toolsDeploy(context.assets, context.mgmtClient, config);

log.info('Import Successful');

return context.assets;
}

0 comments on commit 1a18adf

Please sign in to comment.