File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
.idea
2
+ _output /
Original file line number Diff line number Diff line change @@ -53,16 +53,33 @@ if [ "$#" -ge 1 ]; then
53
53
TARGET_DIR=" $1 "
54
54
fi
55
55
56
+ # Create a temporary local GOBIN under _output/
57
+ LOCAL_GOBIN=" $( pwd) /_output/bin"
58
+ mkdir -p " ${LOCAL_GOBIN} "
59
+
56
60
# Check for apidiff tool, install it if not found
57
61
if ! command -v " ${API_DIFF_TOOL} " & > /dev/null; then
62
+ GOBIN=${LOCAL_GOBIN}
58
63
echo " Installing apidiff into ${GOBIN} ."
59
- go install golang.org/x/exp/cmd/apidiff@latest
64
+ GOBIN=${LOCAL_GOBIN} go install golang.org/x/exp/cmd/apidiff@latest
65
+ # Add GOBIN to PATH
66
+ export PATH=$PATH :${GOBIN}
60
67
fi
61
68
69
+ # Ensure the remote is set
70
+ if ! git remote get-url origin & > /dev/null; then
71
+ echo " Error: 'origin' remote is not set. Please add the remote using:"
72
+ echo " git remote add origin https://github.com/kubernetes-sigs/structured-merge-diff.git"
73
+ exit 1
74
+ fi
75
+
76
+ # Fetch the latest changes from the remote
77
+ git fetch origin
78
+
62
79
# Fetch common base if -r is not set
63
80
if [ -z " ${REFERENCE_REVISION} " ]; then
64
- echo " Determining common base with origin /master..."
65
- REFERENCE_REVISION=$( git merge-base origin /master HEAD)
81
+ echo " Determining common base with upstream /master..."
82
+ REFERENCE_REVISION=$( git merge-base upstream /master HEAD)
66
83
fi
67
84
68
85
# Step 1: Create a temporary directory for worktrees
You can’t perform that action at this time.
0 commit comments