我正在尝试将Git标签设置为我的应用程序的Node ENV变量,以便可以使用它并将其显示在我的React UI上。为此,我定义了以下脚本:
switched to db songs_new
{
"stages" : [
{
"$cursor" : {
"query" : {
},"queryPlanner" : {
"plannerVersion" : 1,"namespace" : "songs_new.songs_test","indexFilterSet" : false,"parsedQuery" : {
},"queryHash" : "8B3D4AB8","planCacheKey" : "8B3D4AB8","winningPlan" : {
"stage" : "COLLSCAN","direction" : "forward"
},"rejectedPlans" : [ ]
}
}
},{
"$lookup" : {
"from" : "songs_test","as" : "artist_name_matches","localField" : "artist_name","foreignField" : "artist_name","unwinding" : {
"preserveNullAndEmptyArrays" : false
}
}
}
],"ok" : 1
}
我也这样尝试过:
"scripts": {
"dev": "NODE_ENV=development VERSION=\"$(git describe --tag)\" concurrently \"npm run server\" \"npm run client\""
}
但是VERSION变量保持为空。
有什么建议我需要改变吗?