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 intogoogle:masterfrom
hemanth:patch-1
Open

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

Conversation

@hemanth
Copy link
Copy Markdown

@hemanth hemanth commented Dec 21, 2015

^ //cc @addyosmani

Copy link
Copy Markdown

@brokerUA brokerUA left a comment

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
Copy link
Copy Markdown
Contributor

Garbee commented Nov 20, 2016

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

@hemanth
Copy link
Copy Markdown
Author

hemanth commented Nov 20, 2016

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

@Garbee
Copy link
Copy Markdown
Contributor

Garbee commented Nov 20, 2016

Windows doesn't have Bash by default.

@hemanth
Copy link
Copy Markdown
Author

hemanth commented Nov 20, 2016

It doesn't have grep either...

@mh-cbon
Copy link
Copy Markdown

mh-cbon commented Nov 20, 2016

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
Copy link
Copy Markdown
Contributor

Garbee commented Nov 20, 2016

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
Copy link
Copy Markdown

mh-cbon commented Nov 20, 2016

+/- 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