mirror of
https://github.com/style-dictionary/style-dictionary.git
synced 2026-09-28 17:52:58 +08:00
16 lines
564 B
JavaScript
16 lines
564 B
JavaScript
const fs = require('fs-extra');
|
|
const glob = require('glob');
|
|
const execSync = require('child_process').execSync;
|
|
const PACKAGE = require('../package.json');
|
|
const packageJSONs = glob.sync('./examples/*/*/package.json', {});
|
|
|
|
packageJSONs.forEach(function (filePath) {
|
|
let pkg = fs.readJsonSync(filePath);
|
|
if (pkg.devDependencies) {
|
|
pkg.devDependencies[PACKAGE.name] = PACKAGE.version;
|
|
fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2));
|
|
}
|
|
// Add the package.json file to staging and it'll get commited
|
|
execSync(`git add ${filePath}`);
|
|
});
|