mirror of
https://github.com/potato47/ccc-devtools.git
synced 2024-12-27 12:08:35 +00:00
14 lines
580 B
JavaScript
14 lines
580 B
JavaScript
|
const AdmZip = require('adm-zip');
|
||
|
const path = require('path');
|
||
|
const fs = require('fs');
|
||
|
|
||
|
const versionPath = path.join(__dirname, '../release/preview-template/version.json');
|
||
|
const versionContent = fs.readFileSync(versionPath, 'utf-8');
|
||
|
const fileObject = JSON.parse(versionContent);
|
||
|
fileObject.version = new Date().toLocaleDateString();
|
||
|
fs.writeFileSync(versionPath, JSON.stringify(fileObject), 'utf-8');
|
||
|
|
||
|
const zip = new AdmZip();
|
||
|
|
||
|
zip.addLocalFolder(path.join(__dirname, '../release/preview-template'));
|
||
|
zip.writeZip(path.join(__dirname, '../release/preview-template.zip'));
|