@rtn263net/cloudhub-rts-electron-sdk
Version:
cloudhub-rts-electron-sdk
30 lines (25 loc) • 936 B
JavaScript
const fs = require('fs');
const action = process.argv[2];
if (!action) {
throw new Error('empty action');
}
const npmjsNpmrcPath = '.npmrc-npmjs';
const defaultNpmrcPath = '.npmrc-default';
const npmrcPath = '.npmrc';
switch (action) {
case 'npmjs': {
console.log(`start copyFileSync, npmjsNpmrcPath:${npmjsNpmrcPath},npmrcPath:${npmrcPath}`);
fs.copyFileSync(npmjsNpmrcPath, npmrcPath);
console.log(`end copyFileSync, npmjsNpmrcPath:${npmjsNpmrcPath},npmrcPath:${npmrcPath}`);
break;
}
case 'default': {
console.log(`start copyFileSync, defaultNpmrcPath:${defaultNpmrcPath},npmrcPath:${npmrcPath}`);
fs.copyFileSync(defaultNpmrcPath, npmrcPath);
console.log(`end copyFileSync, defaultNpmrcPath:${defaultNpmrcPath},npmrcPath:${npmrcPath}`);
break;
}
default:{
throw new Error('action not support');
}
}