Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Avoiding grep#799

Open
hemanth wants to merge 1 commit into
google:masterfrom
hemanth:patch-1
Open

Avoiding grep#799
hemanth wants to merge 1 commit into
google:masterfrom
hemanth:patch-1

Conversation

@hemanth

@hemanth hemanth commented Dec 21, 2015

Copy link
Copy Markdown

^ //cc @addyosmani

@brokerUA brokerUA left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, it's good fix for Windows users, because 'grep' return error.

@Garbee

Garbee commented Nov 20, 2016

Copy link
Copy Markdown
Contributor

Will [[ -z $(git status -s) ]] even run on Windows?

@hemanth

hemanth commented Nov 20, 2016

Copy link
Copy Markdown
Author

Why wouldn't it? It's a standard bash expression.

@Garbee

Garbee commented Nov 20, 2016

Copy link
Copy Markdown
Contributor

Windows doesn't have Bash by default.

@hemanth

hemanth commented Nov 20, 2016

Copy link
Copy Markdown
Author

It doesn't have grep either...

@mh-cbon

mh-cbon commented Nov 20, 2016

Copy link
Copy Markdown

Will [[ -z $(git status -s) ]] even run on Windows?

wrap it in a node script. should be about 10 lines most, if such module does not exist yet.

@brokerUA

Copy link
Copy Markdown

Maybe need check installed bush ( and git) before run commands.
Something like for %i in (git.exe) do ... (Windows cmd is not my specialization)

I just removed grep and install GIT for Windows:
gulp && git status || (echo 'Please commit all changes generated by building'; exit 1)

@Garbee

Garbee commented Nov 20, 2016

Copy link
Copy Markdown
Contributor

I'm not saying the existing command is perfection. However moving forward we should make sure changes to the pipeline work across platforms.

I just removed grep and install GIT for Windows:gulp && git status || (echo 'Please commit all changes generated by building'; exit 1)

This will fail most likely. As git status with all being fine will output On branch master nothing to commit, working tree clean. Which is what we want, however no scenario will cause the or check to exit with a status code of 1 to ever trigger.

@mh-cbon

mh-cbon commented Nov 20, 2016

Copy link
Copy Markdown

+/- this (abused the one liner)

node -e 'require("child_process").spawn("git", ["status"]).stdout.on("data", function(){process.exit(1);});' && echo "ok"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants