【发布时间】:2021-05-13 15:57:18
【问题描述】:
我正在查看 gitflow-avh(一个 VirtualHome 版本)版本 1.12.3 的源代码,它随 Git for Windows 版本 2.31.1 一起提供。我正在查看脚本 git-flow 的第 67-73 行。
*MINGW*)
export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
pwd () {
builtin pwd -W
}
;;
*)
# The sed expression here replaces all backslashes by forward slashes.
# This helps our Windows users, while not bothering our Unix users.)
export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
;;
esac
-W 选项是什么?我只知道 bash 中的 -L 和 -P。我相当有信心这是一种“MINGW 主义”,但我在网上找不到文档。
有人知道-W 选项的作用吗?
【问题讨论】:
-
through a dash (shell) script你怎么知道这是一个破折号脚本?您能否提供有关脚本和环境的更多信息? -
@KamilCuk 当然,当然。我实际上正在查看
gitflow-avh(一个 VirtualHome 版本)版本 1.12.3 的源代码,它随 Git for Windows 版本 2.31.1 一起提供。我正在查看https://github.com/jackfrued/gitflow-avh/blob/develop/git-flow的第 67-73 行。知道这是因为shebang而冲刺。 -
@KamilCuk 我会用更多信息更新问题。