-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Website: exclude files that would cause problems for prebuild or jekyll #4810
Website: exclude files that would cause problems for prebuild or jekyll #4810
Conversation
Delete some files that aren't part of the git repository, but may exist in a checkout and will cause the website build to misbehave or break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving from the response, but might still want to look at rmtree
I've followed the suggestion to exclude things rather than deleting them. I think that's better; deleting the
|
website/prebuild.py
Outdated
children = [ | ||
x | ||
for x in subdir.glob("**/*.md") | ||
if x != readme | ||
and "/node_modules/" not in str(x) | ||
and "/dist/" not in str(x) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
children = [ | |
x | |
for x in subdir.glob("**/*.md") | |
if x != readme | |
and "/node_modules/" not in str(x) | |
and "/dist/" not in str(x) | |
] | |
children = [] | |
for x in subdir.glob("**/*.md"): | |
if x != readme and not ("/node_modules/" in str(x) or "/dist/" in str(x)): | |
children.append(x) |
This just because of the difficulty of reading multi-line comprehension conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, or moving the not
(this is bikeshedding at this point):
children = [ | |
x | |
for x in subdir.glob("**/*.md") | |
if x != readme | |
and "/node_modules/" not in str(x) | |
and "/dist/" not in str(x) | |
] | |
children = [] | |
for x in subdir.glob("**/*.md"): | |
if not (x == readme or "/node_modules/" in str(x) or "/dist/" in str(x)): | |
children.append(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factored out the predicate as a function.
Co-authored-by: Carbon Infra Bot <[email protected]>
…ll (carbon-language#4810) Exclude some files from the website and prebuild steps that aren't part of the git repository, but may exist in a checkout, and if present will cause the website prebuild or build to misbehave or break. --------- Co-authored-by: Carbon Infra Bot <[email protected]>
Exclude some files from the website and prebuild steps that aren't part of the git repository, but may exist in a checkout, and if present will cause the website prebuild or build to misbehave or break.