mirror of
https://github.com/zhigang1992/yarn.git
synced 2026-06-17 05:49:56 +08:00
* Add installationMethod property to package.json References #1139, #942, #1429, #1138 * Make set-installation-method.js executable
13 lines
406 B
JavaScript
Executable File
13 lines
406 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
/**
|
|
* Sets the installationMethod field in package.json. Useful for setting it in
|
|
* shell scripts.
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
|
|
const packageManifestFilename = process.argv[2];
|
|
const packageManifest = require(packageManifestFilename);
|
|
packageManifest.installationMethod = process.argv[3];
|
|
fs.writeFileSync(packageManifestFilename, JSON.stringify(packageManifest, null, 2) + "\n");
|