Skip to content

Instantly share code, notes, and snippets.

@marcodejongh
Created June 13, 2018 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcodejongh/8cc8d16fbc451838581014098dc0fb71 to your computer and use it in GitHub Desktop.
Save marcodejongh/8cc8d16fbc451838581014098dc0fb71 to your computer and use it in GitHub Desktop.
const execSync = require("child_process").execSync;
const writeFileSync = require("fs").writeFileSync;
const resolve = require("path").resolve;
function getLatestDependencyVersion(dependency) {
return JSON.parse(execSync(`yarn info --json ${dependency}`)).data.version;
}
const packageJsonPath = resolve(process.cwd(), "./package.json");
console.log("Updating editor-core");
const packageJson = require(packageJsonPath);
packageJson.devDependencies[
"@atlaskit/editor-core-latest"
] = `npm:@atlaskit/editor-core@${getLatestDependencyVersion(
"@atlaskit/editor-core"
)}`;
console.log(
"Finished updating the dependencies, now need to run yarn to update the lock file"
);
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
execSync("yarn");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment