Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix a security vulnerability
  • Loading branch information
eiskalteschatten committed Feb 21, 2020
1 parent 2dc7305 commit d9ada77
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
5 changes: 5 additions & 0 deletions Readme.md
Expand Up @@ -183,6 +183,11 @@ process.on('SIGINT', () => {

## Release Notes

### 1.0.5

- Fix a critical security vulnerability


### 1.0.4

- Security updates
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "compile-sass",
"version": "1.0.4",
"version": "1.0.5",
"description": "A module to compile SASS on-the-fly and/or save it to CSS files",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
22 changes: 15 additions & 7 deletions src/index.ts
Expand Up @@ -144,16 +144,24 @@ export function setupCleanupOnExit(cssPath: string) {
process.on('SIGINT', () => {
console.log('Exiting, running CSS cleanup');

exec(`rm -r ${cssPath}`, function(error) {
if (error) {
console.error(error);
fs.lstat(cssPath, (error: Error, stats: fs.Stats): void => {
if (stats.isDirectory) {
exec(`rm -r ${cssPath}`, function(error) {
if (error) {
console.error(error);
process.exit(1);
}

console.log('Deleted CSS files');
});
}
else {
console.error('Could not delete CSS files because the given path is not a directory:', cssPath);
process.exit(1);
}

console.log('Deleted CSS files');
});

hasSetupCleanupOnExit = true;
});

hasSetupCleanupOnExit = true;
}
}

0 comments on commit d9ada77

Please sign in to comment.