Skip to content

Commit a06f37c

Browse files
build: support relative cargo-vendor-dir path with non-existing
Supports using CARGO_VENDOR_DIR=/tmp/bob/.. in case bob doesn't exist. Probably won't ever happen but just in case :) Signed-off-by: Tiago Castro <tiagolobocastro@gmail.com>
1 parent ddba1ec commit a06f37c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

scripts/release.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,18 @@ pre_fetch_cargo_deps() {
3737

3838
local outLink="--no-out-link"
3939
local cargoVendorMsg=""
40-
local cargoVendorDir=""
4140
if [ -n "$CARGO_VENDOR_DIR" ]; then
42-
if [ "$(realpath -s "$CARGO_VENDOR_DIR")" = "$(realpath -s "$SCRIPTDIR/..")" ]; then
41+
if [ "$(realpath -ms "$CARGO_VENDOR_DIR")" = "$(realpath -ms "$SCRIPTDIR/..")" ]; then
4342
cargoVendorDir="$CARGO_VENDOR_DIR/$GIT_BRANCH"
4443
else
4544
cargoVendorDir="$CARGO_VENDOR_DIR/$project/$GIT_BRANCH"
4645
fi
47-
46+
cargoVendorMsg="into $(realpath -ms "$cargoVendorDir") "
4847
outLink="--out-link "$cargoVendorDir""
4948
fi
5049

5150
for (( attempt=1; attempt<=maxAttempt; attempt++ )); do
5251
if $NIX_BUILD $outLink -A "$nixAttrPath"; then
53-
[ -n "$cargoVendorDir" ] && cargoVendorMsg="into $(realpath -s "$cargoVendorDir") "
5452
echo "Cargo vendored dependencies pre-fetched "$cargoVendorMsg"after $attempt attempt(s)"
5553
return 0
5654
fi

0 commit comments

Comments
 (0)