updateVersionScript.js 516 B

1234567891011
  1. var fs = require('fs');
  2. var path = require('path');
  3. var fileName = '.ivprog_version';
  4. var date = new Date();
  5. var day = date.getUTCDate() > 9 ? date.getUTCDate() : '0' + date.getUTCDate();
  6. var month = date.getMonth() > 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
  7. var versionString = `${date.getFullYear()}_${month}_${day} ${date.getHours()}_${date.getMinutes()}`;
  8. var versionData = `{ "version":"${versionString}" }`;
  9. var filePath = path.join(__dirname, fileName);
  10. fs.writeFileSync(filePath, versionData);