cross-env with git tag
BhaveshSGupta opened this issue · comments
cross-env
version: ^5.2.0node
version: 10.15.0npm
(oryarn
) version: 6.4.1
Relevant code or config
"make": "cross-env APP_ENV=production cross-env APP_VERSION=`git tag --points-at HEAD` cross-env APP_COMMIT=`git rev-parse HEAD` webpack --config webpack.config.js"
What you did:
When using above code in package.json and running it as npm run-script make
What happened:
Reproduction repository:
Problem description:
Suggested solution:
The common patterns seems to be crossenv [declaration] [command]
where your command would be another crossenv
.
Have you tried an explicit end at the end of each command?
cross-env APP_ENV=production; cross-env APP_VERSION=`git tag --points-at HEAD`; cross-env APP_COMMIT=`git rev-parse HEAD` webpack --config webpack.config.js
Not sure if that will carry on the variables though.
I thought this may be the solution:
"make": "cross-env-shell \"APP_ENV=production cross-env APP_VERSION=`git tag --points-at HEAD` cross-env APP_COMMIT=`git rev-parse HEAD` webpack --config webpack.config.js\"",
What is the minimal command to reproduce this?
Does this work?
"make": "cross-env APP_VERSION=`git tag --points-at HEAD` echo $APP_VERSION`
@jaller94, I was able to fix this by you using something like
"make": "cross-env APP_ENV=production cross-env APP_VERSION=\"git tag --points-at HEAD\" cross-env APP_COMMIT=\"git rev-parse HEAD\" webpack --config webpack.config.js"