import failWithError from './failWithError'; import IManifest from './interfaces/IManifest'; import { Product } from './interfaces/ISettings'; import getManifest from './ssn/getManifest'; import verifyProductName from './ssn/verify/verifyProductName'; const failFunction = failWithError.bind(null, 'node dist/getManifest.js '); if (process.argv.length !== 3) { failFunction(`Error: Expected 1 argument but ${process.argv.length - 2} arguments were supplied.`); } //Check that product name is valid const product = process.argv[2]; if (!verifyProductName(product)) { failFunction(`Error: "${product} is not a valid product name.`); } //Get manifest and write output to console getManifest(product as Product).then((output: IManifest) => { process.stdout.write(JSON.stringify(output)); //process.exit(0); });