src/processor.js
function readPassword(program) {
    prompt.message = "";
    prompt.delimiter = "";

    const passportOption = [{name: 'password', description: 'New password:', hidden: true}];
    const rePassportOption = [{name: 'rePassword', description: 'Re-type new password:', hidden: true}];

    // Try to read password.
    prompt.get(passportOption, (err, result) => {
        if (!err) {
            const password = result.password;
            setTimeout(function () {
                prompt.get(rePassportOption, (err, result) => {
                    if (!err && password == result.rePassword) {
                        program.args.push(password);

                        try {
                            processor.syncFile(program);
                        } catch (err) {
                            console.error(err.message);
                        }
                    } else {
                        console.error("\nPassword verification error.");
                    }
                });
            }, 50);
        } else {
            console.error("\nPassword verification error.");
        }
    });
}
function readPassword(program) {
    prompt.message = "";
    prompt.delimiter = "";

    const passportOption = [{name: 'password', description: 'New password:', hidden: true}];
    const rePassportOption = [{name: 'rePassword', description: 'Re-type new password:', hidden: true}];

    // Try to read password.
    prompt.get(passportOption, (err, result) => {
        if (!err) {
            const password = result.password;
            setTimeout(function () {
                prompt.get(rePassportOption, (err, result) => {
                    if (!err && password == result.rePassword) {
                        program.args.push(password);

                        try {
                            processor.syncFile(program);
                        } catch (err) {
                            console.error(err.message);
                        }
                    } else {
                        console.error("\nPassword verification error.");
                    }
                });
            }, 50);
        } else {
            console.error("\nPassword verification error.");
        }
    });
}
function readPassword ( program ) { prompt . message = "" ; prompt . delimiter = "" ; const passportOption = [ { name : 'password' , description : 'New password:' , hidden : true } ] ; const rePassportOption = [ { name : 'rePassword' , description : 'Re-type new password:' , hidden : true } ] ; // Try to read password. prompt . get ( passportOption , ( err , result ) => { if ( ! err ) { const password = result . password ; setTimeout ( function ( ) { prompt . get ( rePassportOption , ( err , result ) => { if ( ! err && password == result . rePassword ) { program . args . push ( password ) ; try { processor . syncFile ( program ) ; } catch ( err ) { console . error ( err . message ) ; } } else { console . error ( "\nPassword verification error." ) ; } } ) ; } , 50 ) ; } else { console . error ( "\nPassword verification error." ) ; } } ) ; }
Read password.
Read password .