// const cmd = 'rm -rf dist && ' +
// 'echo "build x64 mac" && ' +
// './node_modules/.bin/electron-builder --mac --x64'
// 'echo "build arm64 mac" && ' +
// './node_modules/.bin/electron-rebuild --arch arm64 -f -p work/app && ' +
// './node_modules/.bin/electron-builder --mac --arm64'
// const cmd = './node_modules/.bin/electron-builder --mac'

const { echo, rm } = require('shelljs')
const {
  run,
  writeSrc,
  uploadToR2,
  builder: pb
} = require('./build-common')

async function main () {
  echo('running build for mac')

  echo('build dmg')
  const src = 'mac-x64.dmg'
  rm('-rf', 'dist')
  writeSrc(src)
  await run(`${pb} --mac`)
  await uploadToR2(src)
}

main()
