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

tests/gold/html/Makefile uses bashism #983

Closed
rillig opened this issue May 2, 2020 · 5 comments
Closed

tests/gold/html/Makefile uses bashism #983

rillig opened this issue May 2, 2020 · 5 comments
Labels
bug Something isn't working fixed

Comments

@rillig
Copy link
Contributor

rillig commented May 2, 2020

Describe the bug
The [[ keyword only exists in bash, not in other shells.
It should be replaced with a simple [, and the filename should be enclosed in double quotes.

@rillig rillig added the bug Something isn't working label May 2, 2020
@nedbat
Copy link
Owner

nedbat commented May 3, 2020

Would you like to make a pull request?

@rillig
Copy link
Contributor Author

rillig commented May 4, 2020

No, I don't like to fork a whole repository, make a small change and then delete the repository again just to change a single line. Here's the patch:

--- tests/gold/html/Makefile.orig	2020-01-11 21:34:28.000000000 +0000
+++ tests/gold/html/Makefile	2020-05-02 14:46:46.837476331 +0000
@@ -7,7 +7,7 @@
 
 complete: 	## Copy support files into directories so the HTML can be viewed properly.
 	@for sub in *; do \
-		if [[ -f $$sub/index.html ]]; then \
+		if [ -f "$$sub/index.html" ]; then \
 			echo Copying into $$sub ; \
 			cp -n support/* $$sub ; \
 		fi ; \

@pawamoy
Copy link
Sponsor

pawamoy commented May 4, 2020

It definitely exists in other shells: zsh and busybox ash have it. But dash doesn't indeed.

About forks, you can edit a file directly inside the coverage repo: GitHub will automatically fork it, create a patch-1 branch and open the GitHub editor. Once satisfied you click on commit and it creates a PR. You'd still have to delete the fork from your repositories afterwards though.

@rillig
Copy link
Contributor Author

rillig commented May 4, 2020

See #984; sorry, I forgot to refer back to this issue in the commit.

@nedbat
Copy link
Owner

nedbat commented Jun 28, 2020

Fixed in #984.

@nedbat nedbat closed this as completed Jun 28, 2020
@nedbat nedbat added the fixed label Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants