lib/config.js
function importConfig(optionalPath) {
    process.stdout.write(`Importing your config from '${optionalPath}'`);

    let config;
    try {
        config = fs.readJsonSync(optionalPath, 'utf8');
    } catch (err) {
        checkbox.display('red');
        process.stdout.write(`Can't seem to read '${optionalPath}'`);
        checkbox.display('red');
        process.exit(1);
    }

    fs.removeSync(tokenFile);

    // Overwrite current config
    createConfigFile(config);
    checkbox.display('green');
}
function importConfig(optionalPath) {
    process.stdout.write(`Importing your config from '${optionalPath}'`);

    let config;
    try {
        config = fs.readJsonSync(optionalPath, 'utf8');
    } catch (err) {
        checkbox.display('red');
        process.stdout.write(`Can't seem to read '${optionalPath}'`);
        checkbox.display('red');
        process.exit(1);
    }

    fs.removeSync(tokenFile);

    // Overwrite current config
    createConfigFile(config);
    checkbox.display('green');
}
function importConfig ( optionalPath ) { process . stdout . write ( ` ${ optionalPath } ` ) ; let config ; try { config = fs . readJsonSync ( optionalPath , 'utf8' ) ; } catch ( err ) { checkbox . display ( 'red' ) ; process . stdout . write ( ` ${ optionalPath } ` ) ; checkbox . display ( 'red' ) ; process . exit ( 1 ) ; } fs . removeSync ( tokenFile ) ; // Overwrite current config createConfigFile ( config ) ; checkbox . display ( 'green' ) ; }
Import a config file

@param {String} optionalPath - The path where we will import the config from
@returns {void}
Import a config file