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

Show notice of sass gulp task running #1144

Closed
Aetles opened this issue Nov 5, 2017 · 4 comments
Closed

Show notice of sass gulp task running #1144

Aetles opened this issue Nov 5, 2017 · 4 comments
Assignees

Comments

@Aetles
Copy link
Contributor

Aetles commented Nov 5, 2017

This is not a bug, just a question.

On older FoundationPress projects whenever the watch gulp task found changes in .scss files there was a notice on the command line. But on my latest project the sass task runs fine but does not produce any notice, unless there is an error. Is there anything I can change in gulpfile.babel.js to make it always show output again?

How can this bug be reproduced?

  1. Run npm start
  2. Make a change to a .scss file.

What did you expect to happen?
A notice on the command line telling me that the sass task ran, like:

[15:12:34] Starting 'sass'...
[15:12:36] Finished 'sass' after 1.86 s

What happened instead?
Nothing. (The sass task do run, it's just not telling me about it.)

Please List the Following:

  • OS & version: Linux 3.10.0-614.10.2.lve1.4.55.el7.x86_64
  • Node version (node -v) [Node v4+ is required] : v8.9.0
  • FoundationPress version (see line 3 in package.json): 2.10.4 (but modified)
  • Foundation version (found in node_modules/foundation-sites/package.json) : 6.4.1
@colin-marshall
Copy link
Collaborator

@Aetles looks like some of the gulpfile code I wrote in the previous version didn't get ported over in the Foundation 6.4 update for FP. Gulp was updated to v4 and the watch method is different now. I'll get this sorted out soon.

@tiborp
Copy link

tiborp commented Dec 20, 2017

May I add to this that it would be nice to get noticed if errors appear during the process? I am not proficient enough to add this myself, but I have been using a gulp file that had this function that took care of that:

/**
 * Handle errors and alert the user.
 */
function handleErrors() {
	const args = Array.prototype.slice.call( arguments );

	notify.onError( {
		'title': 'Task Failed [<%= error.message %>',
		'message': 'See console.',
		'sound': 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults
	} ).apply( this, args );

	gutil.beep(); // Beep 'sosumi' again.

	// Prevent the 'watch' task from stopping.
	this.emit( 'end' );
}

Comes in very handy if you are watching your browser and nothing is happening ;-)

@Aetles
Copy link
Contributor Author

Aetles commented Jan 17, 2018

I was using an older FoundationPress project (back in the grunt days!) and it had this nice progress and report for every SASS change, like this:

>> File "scss/site/_global.scss" changed.

Running "sass:dist" (sass) task

Done, without errors.


Execution Time (2018-01-16 16:52:13 UTC+1)
loading tasks  415ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 64%
sass:dist      229ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 36%
Total 645ms

Completed in 1.018s at Tue Jan 16 2018 16:52:14 GMT+0100 (CET) - Waiting...

I've yet to figure out how to make the latest workflow present this kind of information (or any at all) when re-compiling sass.

colin-marshall added a commit to colin-marshall/FoundationPress that referenced this issue Jan 18, 2018
Relevant issue olefredrik#1144. Updates the watch task with event listeners on change and unlink events for the php and sass watch tasks.
@Aetles
Copy link
Contributor Author

Aetles commented Jan 23, 2018

#1210 solves this issue, thank you!

@Aetles Aetles closed this as completed Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants