Created
February 11, 2020 06:41
-
-
Save Tauka/2ced9d2d9a489d3000783dc084d0e0af to your computer and use it in GitHub Desktop.
Script that writes today's date in .env file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const today = new Date(); | |
const dd = String(today.getDate()).padStart(2, '0'); | |
const mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! | |
const yyyy = today.getFullYear(); | |
const dateString = `${dd}.${mm}.${yyyy}`; | |
fs.writeFileSync(path.join(__dirname, '.env'), `VERSION=${dateString}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment