Every time I compress my project, I need to manually sync version
with the generated file name like CCCC007.tgz
In my package.json, compress-files
script like below:
{
"name": "MyBuild",
"version": "0.0.7",
"scripts": {
"dev": "nodemon --legacy-watch ./src",
"start": "node src/",
"compress-files": "tar --exclude='./node_modules' --exclude='./myBuild.pem' --exclude='./config/local.json' -zcvf ~/CCCC007.tgz . ",
},
}
I am wondering whether I can make the version
as variable and use it in the script compress-files
with something like:
"name": "MyBuild",
"version": "0.0.7",
"scripts": {
"dev": "nodemon --legacy-watch ./src",
"start": "node src/",
"compress-files": "tar --exclude='./node_modules' --exclude='./myBuild.pem' --exclude='./config/local.json' -zcvf ~/CCCC${this.version}.tgz . ",
},