diff --git a/.npmrc b/.npmrc index e9f8e69b..86474925 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1 @@ -package-lock=false @mvrdevelopment:registry=https://npm.pkg.github.com diff --git a/change-package-name.js b/change-package-name.js new file mode 100644 index 00000000..982966e9 --- /dev/null +++ b/change-package-name.js @@ -0,0 +1,24 @@ +const fs = require('fs'); + +class PackageJSONManager { + constructor() { + this.packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); + } + + updateKey(key, value) { + if (!key || !value) return; + this.packageJson[key] = value; + } + + save() { + fs.writeFileSync('package.json', JSON.stringify(this.packageJson, null, 4) + '\n'); + } +} + +const manager = new PackageJSONManager(); +process.argv.forEach((key, index) => { + if (key.startsWith('--')) { + manager.updateKey(key.substring(2), process.argv[index + 1]); + } +}) +manager.save() \ No newline at end of file