I have a package.json file and I have this script to create 2 separate files one for version and other one for date.
When i run the command, it generates the version-npm.txt
with correct data holding the current version, but the version.txt file is generated with the exact script instead, it contains date +"%d/%m/%Y %T"
"scripts": {
"versions": "node -e \"console.log(require('./package.json').version);\" > ./public/version-npm.txt && echo `date +\"%d/%m/%Y %T\"` > ./public/version.txt"
}
I need this to be updated with the current date and time. is there any other way to it or can you help me fix it?
i tried writing the date as \"$(date)\"
still the same, now i get \"$(date)\"