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

Does nowrite ever take effect? #361

Open
avdi opened this issue Sep 25, 2020 · 2 comments
Open

Does nowrite ever take effect? #361

avdi opened this issue Sep 25, 2020 · 2 comments

Comments

@avdi
Copy link

avdi commented Sep 25, 2020

--dry-run sets both nowrite(false) and options.dry_run = true. The thing is, so long as options.dry_run == true, Task execution short-circuits before it ever gets to execute any FileUtils methods.

So the question is... does nowrite/noop ever take effect?

The only way I can find to get Rake to tell me what it would do (without doing it) is:

$ rake -E 'Rake.nowrite(true)' 

(That's the behavior I expected from --dry-run, honestly.)

So... are the noop/nowrite branches effectively dead code? Or am I missing something?

@avdi
Copy link
Author

avdi commented Sep 25, 2020

(For comparison, GNU Make's --dry-run/-n prints the commands it WOULD execute, without executing them.)

@jasonkarns
Copy link
Contributor

This also seems to make the when_writing method useless, since it would always be true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants