/* eslint-disable no-var */

// Native
const path = require('path')
const fs = require('fs')

const dist = path.join(__dirname, 'dist')
const src = path.join(__dirname, 'src')

// Don't install on CI
if (process.env.CANNER_CI) {
  console.log('skip postinstall in @canner/cli');
  process.exit(0)
}

// Don't install when developing locally
if (fs.existsSync(src)) {
  // eslint-disable-next-line unicorn/no-process-exit
  process.exit(0)
}

require(path.join(dist, 'download.js'))
