mashr
Version:
Simple data pipeline framework for GCP's BigQuery
27 lines (20 loc) • 636 B
JavaScript
const { getDefaultZone } = require('../gcp/getDefaultZone');
const { setupDirectoriesAndFiles } = require('./setupDirectoriesAndFiles');
const { copyMashrConfigTemplate } = require('./copyMashrConfigTemplate');
const {
getMashrPath,
exists,
} = require('./fileUtils');
const catchSetupAndConfig = async(homeDir, template) => {
await getDefaultZone();
const mashrPath = await getMashrPath(homeDir);
const mashrDirExists = await exists(mashrPath);
if (!mashrDirExists) {
await setupDirectoriesAndFiles(homeDir);
}
copyMashrConfigTemplate(template);
return true;
};
module.exports = {
catchSetupAndConfig,
};