heroku / heroku-cli-command
1
function toggle(onoff: string) {
2 0
  const cp = require('child_process')
3 3
  if (yubikey.platform !== 'darwin') return
4 0
  try {
5 0
    cp.execSync(
6
      `osascript -e 'if application "yubiswitch" is running then tell application "yubiswitch" to ${onoff}'`,
7
      {stdio: 'inherit'},
8
    )
9
  } catch {}
10
}
11

12 0
export const yubikey = {
13 0
  disable: () => toggle('KeyOff'),
14 0
  enable: () => toggle('KeyOn'),
15
  platform: process.platform,
16
}

Read our documentation on viewing source code .

Loading