const { execSync } = require('child_process')
const TuiaAutoUpload = require('tuia-auto-upload')
const path = require('path')

async function build() {
  // execSync(`cd web && yarn && yarn run build`, { stdio: [0, 1, 2] })
  const uploader = await new TuiaAutoUpload({
    dir: path.join(__dirname, '../dist/assets/'),
    originDir: '/assets/',
  })

  await uploader.start()
}

build().catch((err) => {
  console.log()
  console.log(`build error: `, err)
})
