fixx git.sh for win

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2024-07-17 13:42:23 +10:00 committed by GitHub
parent a4b61cde23
commit 2552f24abb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@ GIT="$(mktemp -d 2>/dev/null || mktemp -d -t 'git')"
if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; then
# Convert it to windows path so `--git "file://$GIT"` would work
# on windows.
GIT="$(cygpath -m "$GIT")"
GIT="$(cygpath -w "$GIT")"
fi
git init "$GIT"
@ -49,13 +49,15 @@ cp -r manifests/workspace/* "$GIT"
)
COMMIT_HASH="$(cd "$GIT" && git rev-parse HEAD)"
source="(git+file://$(cygpath -m "$GIT")#$COMMIT_HASH)"
# Install cargo-binstall using `--git`
"./$1" binstall --force --git "file://$GIT" --no-confirm cargo-binstall
test_cargo_binstall_install
cat "$CARGO_HOME/.crates.toml"
grep -F "cargo-binstall 0.12.0 (git+file://$GIT#$COMMIT_HASH)" <"$CARGO_HOME/.crates.toml"
grep -F "cargo-binstall 0.12.0 $source" <"$CARGO_HOME/.crates.toml"
# Install cargo-watch using `--git`
"./$1" binstall --force --git "file://$GIT" --no-confirm cargo-watch
@ -66,4 +68,4 @@ echo "$cargo_watch_version"
[ "$cargo_watch_version" = "cargo-watch 8.4.0" ]
cat "$CARGO_HOME/.crates.toml"
grep -F "cargo-watch 8.4.0 (git+file://$GIT#$COMMIT_HASH)" <"$CARGO_HOME/.crates.toml"
grep -F "cargo-watch 8.4.0 $source" <"$CARGO_HOME/.crates.toml"