Skip to content

Commit

Permalink
fix: add check for lint-staged files before stashing changes (lint-st…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Bentvelzen committed Jan 24, 2019
1 parent 406a0c0 commit c7c70da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/runAll.js
Expand Up @@ -54,6 +54,9 @@ module.exports = function runAll(config) {
return `No staged files match ${task.pattern}`
}
return false
},
hasStagedFiles: () => {
return task.fileList.length > 0
}
}))

Expand All @@ -62,7 +65,12 @@ module.exports = function runAll(config) {
renderer
}

if (tasks.length) {
let hasStagedTaskFiles = false;
tasks.forEach((task) => {
hasStagedTaskFiles = hasStagedTaskFiles || task.hasStagedFiles();
})

if (hasStagedTaskFiles) {
// Do not terminate main Listr process on SIGINT
process.on('SIGINT', () => {})

Expand Down

0 comments on commit c7c70da

Please sign in to comment.