#!/usr/bin/env node
const fs = require('fs-extra');
const { devtoolsPath, auxiliaryToolPath } = require('../');
const path = require('path');
console.log(require('../package.json').version);

let src = devtoolsPath;
let dest = path.join(process.cwd(), 'node_modules/@hap-toolkit/chrome-devtools-frontend/out/Default/resources/inspector');

if (process.argv.length > 2 && process.argv[2] === '--app') {
	src = auxiliaryToolPath;
	dest = path.join(process.cwd(), 'node_modules/@hap-toolkit/chrome-devtools-frontend/out/default/resources/inspector/auxiliary_tool/client');
}

console.log(`sync from ${src} to ${dest}`);

fs.emptyDirSync(dest);
fs.copySync(src, dest);
