From 1a18adf40f71638c975a593db1fa0c2266029403 Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Fri, 20 May 2022 16:33:19 -0400 Subject: [PATCH] Returning assets for programatically called functions --- src/commands/export.ts | 6 ++++-- src/commands/import.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/export.ts b/src/commands/export.ts index ac77db24a..b3986c2b1 100644 --- a/src/commands/export.ts +++ b/src/commands/export.ts @@ -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 { const { output_folder: outputFolder, base_path: basePath, @@ -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; } diff --git a/src/commands/import.ts b/src/commands/import.ts index f84c85897..e92bf753d 100644 --- a/src/commands/import.ts +++ b/src/commands/import.ts @@ -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 { const { input_file: inputFile, base_path: basePath, @@ -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; }