Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Safer clean #115

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ CONFIG_VARS = curl -fsL https://ft-next-config-vars.herokuapp.com/$1/$(call APP_

# clean
clea%:
# HACK: Can't use -e option here because it's not supported by our Jenkins
@git clean -fxd
# clean just untracked files if not on CircleCI
Copy link
Contributor

Choose a reason for hiding this comment

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

"clean just gitignored files if not on CircleCI"

@if [ -z $(CIRCLECI) ]; then git clean -Xfd; else git clean -xfd; fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this logic inverted? I.e. We only want to clean .gitignored files locally and all in CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@phamann the -z means it "is null, that is, has zero length"

so, when CIRCLECI is not set then we use -Xfd and when CIRCLECI is set then we use -xfd

That what we want, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep :) so my only comment now is that the conditional is confusing (at least for me). Can it instead read:

@if [ -e $(CIRCLECI) ]; then git clean -xfd; else git clean -Xfd; fi

@$(DONE)

cleanx:
Copy link
Contributor

Choose a reason for hiding this comment

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

This will have to be named something different because on the clean%, make cleanx would just call make clean

Copy link
Contributor

@leggsimon leggsimon Sep 30, 2016

Choose a reason for hiding this comment

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

Oh actually it turns out it doesn't (a fully specified name does take precedence) buuut I would still call it something else like nuke

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leggsimon the peace hippy that I am, I feel it my duty to encourage people not to nuke...

Copy link
Contributor

Choose a reason for hiding this comment

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

You're the one that wants it 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

But seriously I think it should be more clearly different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leggsimon any suggestion for an alternative word to nuke? Preferably one that isn't violent... and 3 or 4 letters

Copy link
Contributor

Choose a reason for hiding this comment

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

make new
make tidy
make fresh
make i-give-up-take-me-back-to-how-it-was-before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great ideas, @leggsimon I really like the make fresh one. So, I've just done that.

I think we're good to go now?

@git clean -xfd
@$(DONE)

# install
Expand Down