Skip to content

Commit

Permalink
feat: prevent process exit when no SCSS files are found
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Nov 27, 2024
1 parent ee92706 commit 07305eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class SassStyleTemplate {

/**
* Watches for changes in SASS files and processes them.
* @param {string} glob - The glob pattern for SASS files.
* @param {string | string[]} glob - The glob pattern for SASS files.
*/
watchSass(glob) {
const watcher = chokidar.watch(glob, {ignoreInitial: true});
Expand Down Expand Up @@ -280,14 +280,8 @@ export class SassStyleTemplate {
* Initializes the SASS style template processing.
*/
init() {
if (this.globFiles && this.globFiles.length > 0) {
this.watchSass(this.globFiles);
this.globSassFile(this.renderStylesTemplate);
} else {
console.info(
`${color.BrightCyan}[sass]${color.grey} No SASS files found to process. ${color.reset}`
);
process.exit(0);
}
const globFiles = this.globFiles && this.globFiles.length > 0 ? this.globFiles : [];
this.watchSass(globFiles);
this.globSassFile(this.renderStylesTemplate);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockquote/sass-style-template",
"version": "4.0.1",
"version": "4.0.2",
"description": "A SCSS watcher with autoprefixer for building Web Components using Lit and SASS.",
"keywords": [
"lit",
Expand Down

0 comments on commit 07305eb

Please sign in to comment.