зеркало из https://github.com/mislav/hub.git
Make `script/build` compatible with Windows
The best way to run this is in the GitHub for Windows shell.
This commit is contained in:
Родитель
d01968c266
Коммит
283782497b
22
script/build
22
script/build
|
@ -5,16 +5,26 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
windows=
|
||||||
|
[[ $OS == Windows* ]] && windows=1
|
||||||
|
|
||||||
setup_gopath() {
|
setup_gopath() {
|
||||||
|
TMPDIR="${LOCALAPPDATA:-$TMPDIR}"
|
||||||
TMP_GOPATH="${TMPDIR:-/tmp}/go"
|
TMP_GOPATH="${TMPDIR:-/tmp}/go"
|
||||||
TMP_SELF="${TMP_GOPATH}/src/github.com/github/hub"
|
TMP_SELF="${TMP_GOPATH}/src/github.com/github/hub"
|
||||||
|
|
||||||
export GOPATH=${TMP_GOPATH}
|
if [ -n "$windows" ]; then
|
||||||
|
export GOPATH="${TMP_GOPATH//\//\\}"
|
||||||
if [ ! -e "$TMP_SELF" ]; then
|
else
|
||||||
mkdir -p "${TMP_SELF%/*}"
|
export GOPATH="$TMP_GOPATH"
|
||||||
ln -snf "$PWD" "$TMP_SELF"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${TMP_SELF%/*}"
|
||||||
|
ln -snf "$PWD" "$TMP_SELF" 2>/dev/null || {
|
||||||
|
rm -rf "$TMP_SELF"
|
||||||
|
mkdir "$TMP_SELF"
|
||||||
|
cp -R "$PWD"/* "${TMP_SELF}/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
find_source_files() {
|
find_source_files() {
|
||||||
|
@ -41,7 +51,7 @@ test_hub() {
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"" )
|
"" )
|
||||||
build_hub hub
|
build_hub hub${windows:+.exe}
|
||||||
;;
|
;;
|
||||||
-o )
|
-o )
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
bash script\build %*
|
Загрузка…
Ссылка в новой задаче