Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎁 Don't force the vendoring of deps #311

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ use (
.
schema
test
test/vendorproj
Copy link
Contributor Author

@cardil cardil Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record: I added this submodule to test if the scripts allow having a mixed project, with some modules having vendor/ and some don't.

)
13 changes: 9 additions & 4 deletions library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -718,18 +718,23 @@ function __go_update_deps_for_module() {
fi
fi

group "Go mod tidy and vendor"
group "Go mod tidy"

# Prune modules.
local orig_pipefail_opt=$(shopt -p -o pipefail)
local orig_pipefail_opt
orig_pipefail_opt=$(shopt -p -o pipefail)
set -o pipefail
go mod tidy 2>&1 | grep -v "ignoring symlink" || true
go mod vendor 2>&1 | grep -v "ignoring symlink" || true
if [[ "${FORCE_VENDOR:-false}" == "true" ]] || [ -d vendor ]; then
group "Go mod vendor"
go mod vendor 2>&1 | grep -v "ignoring symlink" || true
fi
eval "$orig_pipefail_opt"

if ! [ -d vendor ]; then
if ! [[ "${FORCE_VENDOR:-false}" == "true" ]] && ! [ -d vendor ]; then
return 0
fi

group "Removing unwanted vendor files"

# Remove unwanted vendor files
Expand Down
201 changes: 0 additions & 201 deletions schema/third_party/VENDOR-LICENSE/github.com/go-logr/logr/LICENSE

This file was deleted.

This file was deleted.

Loading
Loading