Skip to content

Commit 0f1ff08

Browse files
committed
Deploy Production Code for Commit a9c2c5a 🚀
1 parent a9c2c5a commit 0f1ff08

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/fetch.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import 'cross-fetch/polyfill';
22
import { DataInterface, ExportInterface, Status } from './constants';
33
export declare function retrieveData({ debug: requestDebug, endpoint, configuration, auth, isTokenRequest, retry }: DataInterface): Promise<string>;
4-
export declare function generateExport({ data, saveLocation, saveName }: ExportInterface): Promise<Status>;
4+
export declare function generateExport({ data, format, saveLocation, saveName }: ExportInterface): Promise<Status>;

lib/fetch.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ function retrieveData({ debug: requestDebug, endpoint, configuration, auth, isTo
6262
}
6363
exports.retrieveData = retrieveData;
6464
/* Saves the data to the local file system and exports an environment variable containing the retrieved data. */
65-
function generateExport({ data, saveLocation, saveName }) {
65+
function generateExport({ data, format, saveLocation, saveName }) {
6666
return __awaiter(this, void 0, void 0, function* () {
6767
(0, core_1.info)('Saving the data... 📁');
68+
const file = `${saveLocation ? saveLocation : 'fetch-api-data-action'}/${saveName ? saveName : 'data'}.${format ? format : 'json'}`;
6869
yield (0, io_1.mkdirP)(`${saveLocation ? saveLocation : 'fetch-api-data-action'}`);
70+
yield fs_1.promises.writeFile(file, data, 'utf8');
71+
(0, core_1.info)(`Saved ${file} 💾`);
6972
yield fs_1.promises.writeFile(`${saveLocation ? saveLocation : 'fetch-api-data-action'}/${saveName ? saveName : 'data'}.json`, data, 'utf8');
7073
(0, core_1.exportVariable)('fetch-api-data', data);
7174
return constants_1.Status.SUCCESS;

0 commit comments

Comments
 (0)