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

Fix a check that prevents compiling .css files to themselves #968

Merged
merged 5 commits into from
Mar 11, 2020
Merged

Fix a check that prevents compiling .css files to themselves #968

merged 5 commits into from
Mar 11, 2020

Conversation

georgpukk
Copy link
Contributor

* fixes the infinite loop issue in --watch mode
* previously it compared relative destination to absolute source
* p.relative(destination) is used to replace backslashes
@ReidLitkauo
Copy link

Thank you so much for this commit! I just learned SASS and this bug is the only thing preventing me from fully integrating SASS into my workflow. For now I'm just running sass from the command line every time I make an edit which is super tedious, but with this I can just set it as a daemon and forget it.

Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

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

Thanks for the commit, and sorry it's taken so long to review! Have you been able to reproduce this in a test case? I'd like to get a regression test in place before committing a fix for this.

lib/src/executable/watch.dart Outdated Show resolved Hide resolved
Co-Authored-By: Natalie Weizenbaum <[email protected]>
@georgpukk
Copy link
Contributor Author

This is the reproducing test case (at least on Windows 10).

test("goes to infinite loop", () async {
	await d.file("test.scss", "a {b: c}").create();

	var sass = await watch(["."]);
	await expectLater(
		sass.stdout, emits('Compiled test.scss to test.css.'));
	await expectLater(sass.stdout, _watchingForChanges);
	await tickIfPoll();

	await d.file("test.scss", "r {o: g}").create();
	await expectLater(
		sass.stdout, emits('Compiled test.scss to test.css.'));

	await tickIfPoll();

	await d.file("test.scss", "x {y: z}").create();
	await expectLater(
		sass.stdout, emits('Compiled test.scss to test.css.'));

	await sass.kill();

	await d
		.file("test.css", equalsIgnoringWhitespace("x { y: z; }"))
		.validate();
});

@nex3
Copy link
Contributor

nex3 commented Mar 9, 2020

Can you add that to the existing watch tests?

@nex3 nex3 mentioned this pull request Mar 11, 2020
@nex3 nex3 merged commit 4d78316 into sass:master Mar 11, 2020
@georgpukk georgpukk deleted the watch-bug branch March 12, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants