// J:\_ALL\CODE\gitee\constellations\Capricorn\_JOB\HE\2023-10-09--electronTools\src\renderer\utils\my\index.js
// 打开cmd
function openCmd(cmd, options) {
  const exec = require('child_process').exec
  var _cmd = 'start cmd /k ' + cmd
  console.log(_cmd, options)
  exec(_cmd, options)
}

// 打开外链
function openExternal(link) {
  if (process) {
    const { shell } = require('electron')
    console.log(link)
    shell.openExternal(link)
  } else {
    window.open(link)
    // const exLinksBtn = document.getElementById('open-ex-links')
    // exLinksBtn.addEventListener('click', (event) => {
    //   shell.openExternal('http://electron.atom.io')
    // })
  }
}

// module.exports = {
export {
  openCmd,
  openExternal
}