Skip to content

Commit

Permalink
feat(package): add release date
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Sep 1, 2021
1 parent b2a5ffe commit 5d04e33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ const pkg = require('../package.json');
const childPkg = require('../package/package.json');

async function release() {
const date = new Date();
const formatter = new Intl.DateTimeFormat('en', {
day: 'numeric',
year: 'numeric',
month: 'long',
});
const releaseDate = formatter.format(date);

const options = await inquirer.prompt([
{
type: 'input',
Expand Down Expand Up @@ -66,6 +74,7 @@ async function release() {
// Set version
pkg.version = options.version;
childPkg.version = options.version;
childPkg.releaseDate = releaseDate;

fs.writeFileSync(
path.resolve(__dirname, '../package.json'),
Expand Down

0 comments on commit 5d04e33

Please sign in to comment.