1
讀的package.json版本我有一個package.json
文件看起來像這樣:內的package.json
{
"name": "myapp",
"version": "0.0.1",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "webpack-dev-server --port=4200",
"build": "webpack",
"docker-build": "docker build -t myapp .",
"docker-run": "docker run -d --name myapp -p 9090:9090 myapp",
"docker-push": "docker build -t myapp . & docker tag myapp myrepo/myapp:{$VERSION} & docker push myrepo/myapp:{$VERSION}"
},
...
}
我試着去獲得的版本號,當我運行npm run docker-push
所以它會自動標記與版本的發佈編號爲package.json
。我怎樣才能做到這一點?