function shouldCreateKeyFile(keyFilePath, ifKeyExists) {
    if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(keyFilePath)) {
        // should create if file does not exist
        return true;
    }
    switch (ifKeyExists) {
        case "replace":
            // remove file and should create if replace
            fs__WEBPACK_IMPORTED_MODULE_0___default().unlinkSync(keyFilePath);
            return true;
        case "ignore":
            // should NOT create if ignore
            return false;
        default:
            // error otherwise
            throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
    }
}
/**
 * should create SSH key file?
 * @param keyFilePath path of key file
 * @param ifKeyExists action if SSH key exists
 * @returns Yes/No
 */
should create SSH key file.
@param keyFilePath path of key file
@param ifKeyExists action if SSH key exists
@returns Yes/No
should create SSH key file . @param keyFilePath path of key file @param ifKeyExists action if SSH key exists @returns Yes / No
function shouldCreateKeyFile(keyFilePath, ifKeyExists) {
    if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(keyFilePath)) {
        return true;
    }
    switch (ifKeyExists) {
        case "replace":
            fs__WEBPACK_IMPORTED_MODULE_0___default().unlinkSync(keyFilePath);
            return true;
        case "ignore":
            return false;
        default:
            throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
    }
}
function shouldCreateKeyFile ( keyFilePath , ifKeyExists ) { if ( ! fs__WEBPACK_IMPORTED_MODULE_0___default ( ) . existsSync ( keyFilePath ) ) { return true ; } switch ( ifKeyExists ) { case "replace" : fs__WEBPACK_IMPORTED_MODULE_0___default ( ) . unlinkSync ( keyFilePath ) ; return true ; case "ignore" : return false ; default : throw new Error ( ` ` ) ; } }
should create SSH key file?
should create SSH key file?
// should create if file does not exist // remove file and should create if replace // should NOT create if ignore // error otherwise