Skip to content

Commit

Permalink
chore: add script to mark current packages to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Sep 29, 2024
1 parent 06ef5d0 commit 6eaa974
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/tag.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import fs from 'fs';
import { execSync } from 'child_process';
import console from 'console';

// Mark all current packages as latest
fs.readdirSync('./packages').forEach((packageName, index) => {
if (packageName === 'g-devtool') return;

const pkgJson = JSON.parse(
fs.readFileSync(`./packages/${packageName}/package.json`, 'utf-8'),
);

const command = `npm dist-tag add ${pkgJson.name}@${pkgJson.version} latest`;
console.log(`[${index}] ` + command);
try {
execSync(command);
} catch (e) {
console.log(e);
}
});

0 comments on commit 6eaa974

Please sign in to comment.