Skip to content

Commit 5664d29

Browse files
committed
Support single command as a string in config
1 parent 544a303 commit 5664d29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
const cli = require('commander');
54
const util = require('util');
65
const process = require('process');
@@ -12,7 +11,8 @@ cli
1211
.version(pkg.version, '-v, --version')
1312
.parse(process.argv);
1413

15-
async function runCommandsIfFileChanged(fileToCheck, commandsList) {
14+
async function runCommandsIfFileChanged(fileToCheck, commands) {
15+
const commandsList = Array.isArray(commands) ? commands : [commands];
1616
const commandsString = commandsList.map(x => `"${x}"`).join(' ');
1717
const command = `./bin/git-run-if-changed.sh "${fileToCheck}" ${commandsString}`;
1818
const response = await exec(command);

0 commit comments

Comments
 (0)