最近在打包代码的时候,想着把代码打包后的文件名改成 当前 git 分支的名字,便于区分,可以在脚本中执行 下边的命令就可以了获取 当前分支的名字了
TARGET_FILE_TMP=`sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' -e 's/\//\_/g'`
最近在打包代码的时候,想着把代码打包后的文件名改成 当前 git 分支的名字,便于区分,可以在脚本中执行 下边的命令就可以了获取 当前分支的名字了
TARGET_FILE_TMP=`sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' -e 's/\//\_/g'`