lib/generate/index.js
function handleFileSwagger(profile, profileKey) {
    const inputFilePath = path.resolve(currentDir, profile.file);
    console.log(chalk`{green [${profileKey}]} Input swagger file : {cyan ${inputFilePath}}`);
    fs.readFile(inputFilePath, 'utf8', (error, swagger) => {
        if (error) {
            console.log(chalk`{red Cannot read swagger file '{bold ${profile.file}}'.}`);
            console.log(chalk.red(error));
        } else {
            handleSwagger(swagger, profile, profileKey);
        }
    });
}
function handleFileSwagger(profile, profileKey) {
    const inputFilePath = path.resolve(currentDir, profile.file);
    console.log(chalk`{green [${profileKey}]} Input swagger file : {cyan ${inputFilePath}}`);
    fs.readFile(inputFilePath, 'utf8', (error, swagger) => {
        if (error) {
            console.log(chalk`{red Cannot read swagger file '{bold ${profile.file}}'.}`);
            console.log(chalk.red(error));
        } else {
            handleSwagger(swagger, profile, profileKey);
        }
    });
}
function handleFileSwagger ( profile , profileKey ) { const inputFilePath = path . resolve ( currentDir , profile . file ) ; console . log ( chalk ` ${ profileKey } ${ inputFilePath } ` ) ; fs . readFile ( inputFilePath , 'utf8' , ( error , swagger ) => { if ( error ) { console . log ( chalk ` ${ profile . file } ` ) ; console . log ( chalk . red ( error ) ) ; } else { handleSwagger ( swagger , profile , profileKey ) ; } } ) ; }
Reads the swagger json from a file specified in the profile.
@param {Profile} profile - The profile being handled.
@param {String} profileKey - The name of the profile.
Reads the swagger json from a file specified in the profile .