@heroku-cli/command
Version:
base class for Heroku CLI commands
18 lines (17 loc) • 543 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.yubikey = void 0;
function toggle(onoff) {
const cp = require('child_process');
if (exports.yubikey.platform !== 'darwin')
return;
try {
cp.execSync(`osascript -e 'if application "yubiswitch" is running then tell application "yubiswitch" to ${onoff}'`, { stdio: 'inherit' });
}
catch (_a) { }
}
exports.yubikey = {
disable: () => toggle('KeyOff'),
enable: () => toggle('KeyOn'),
platform: process.platform,
};