这是indexloc提供的服务,不要输入任何密码
Skip to content

Plumb through errors in globbing. #1129

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

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Conversation

nathanhammond
Copy link
Contributor

@nathanhammond nathanhammond commented Apr 27, 2022

This PR is a fast-follow to #1108 to plumb through the error cases. This work is intentionally split to reduce the scope for each change (1. change implementation, 2. change interface).

This results in user-facing changes if they have globs or patterns that push them outside of their root directory.

@vercel
Copy link

vercel bot commented Apr 27, 2022

@nathanhammond is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Apr 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
turbo-site ✅ Ready (Inspect) Visit Preview Apr 28, 2022 at 0:29AM (UTC)

// isRelativePath ensures that the the requested file path is a child of `from`.
func isRelativePath(from string, to string) (isRelative bool, err error) {
// checkRelativePath ensures that the the requested file path is a child of `from`.
func checkRelativePath(from string, to string) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no reason for this to have two return values, only one of them was ever needed to be checked. I've combined them, changed the name, and dropped the return argument names.

"/repos/some-app/dist/js/node_modules/browserify.js",
},
want: []string{},
wantErr: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These represent behavior changes. Previously we would silently proceed and now we fail.

Likely easy fixes for anybody who encounters it, but possibly noisy/disruptive on upgrade.

@kodiakhq kodiakhq bot merged commit 0057c40 into vercel:main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants