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

Adds watching for less files -- closes #10 #14

Merged
merged 2 commits into from
May 2, 2017

Conversation

alfigureitout
Copy link
Contributor

No description provided.

@@ -9,6 +9,7 @@ import fs from 'fs';
import less from 'less';
import mkdirp from 'mkdirp';
import path from 'path';
import chokidar from 'chokidar';
Copy link
Owner

Choose a reason for hiding this comment

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

alphabetize imports

console.log(chalk.red('--watch not yet implemented'));
process.exit(1);
chokidar.watch(PATH_TO_WATCH).on('all', (event, path) => {
if (event === "add" || event === "change") {
Copy link
Owner

Choose a reason for hiding this comment

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

would prefer a switch statement instead of a series of if statments

console.log(chalk.blue(event, path));
compileLessAndWriteToCSSFile(path)
.then(() => {
console.log(chalk.green('Done compiling ' + path));
Copy link
Owner

@brenmcnamara brenmcnamara Apr 29, 2017

Choose a reason for hiding this comment

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

Use template strings:

`Done compiling ${path}`

console.log(chalk.red('--watch not yet implemented'));
process.exit(1);
chokidar.watch(PATH_TO_WATCH).on('all', (event, path) => {
if (event === "add" || event === "change") {
Copy link
Owner

Choose a reason for hiding this comment

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

no double quotes, only single quotes

Copy link
Owner

@brenmcnamara brenmcnamara left a comment

Choose a reason for hiding this comment

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

Overall looks good, just some styling things

console.log(chalk.green('Done compiling ' + path));
});
}
if (event === "unlink") {
Copy link
Owner

Choose a reason for hiding this comment

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

single quotes

const cssMapFilename = Stylesheets.getDistCSSMapFileForLessFile(path);
Promise.all([removeFile(cssFilename), removeFile(cssMapFilename)]);
}
if (event === "unlinkDir") {
Copy link
Owner

Choose a reason for hiding this comment

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

single quotes

const cssFilepath = Stylesheets.getDistCSSPathForLessPath(path);
removePath(cssFilepath);
}
if (event === "addDir" && path !== PATH_TO_WATCH) {
Copy link
Owner

Choose a reason for hiding this comment

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

single quotes

@brenmcnamara brenmcnamara merged commit 3867623 into brenmcnamara:master May 2, 2017
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.

None yet

2 participants