const fs = require('fs');

if(process.argv.length != 3) {
    console.log('no match parameters');
    console.log('ex> node publish.js [account]');
    return 0;
}

const srcPath = `src/Config/Publish/index.${process.argv[2]}.js`;
const destPath = `src/Config/index.js`;

if(!fs.existsSync(srcPath)) {
    console.log(`not found ${srcPath} file...`);
    return 0;
}

console.log(`COPY [${srcPath}] TO [${destPath}]`);
fs.copyFileSync(srcPath, destPath);
console.log(`${srcPath} was copied to ${destPath}`);

return 1;