UNPKG

@acurast/cli

Version:

A cli to interact with the Acurast Cloud.

22 lines 1.27 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { readdir } from 'fs/promises'; import { ACURAST_DEPLOYMENTS_PATH } from '../constants.js'; export const readFilesInDeployFolder = (searchString) => __awaiter(void 0, void 0, void 0, function* () { // Read all files from a folder, check if string is in any of the filenames const folderPath = ACURAST_DEPLOYMENTS_PATH; const files = yield readdir(folderPath); const file = files.find((file) => file.includes(searchString)); if (!file) { console.log('No matching file found'); } return file; }); //# sourceMappingURL=readFilesInDeployFolder.js.map