Skip to content

Commit 72ead50

Browse files
committed
Improve readability of script
1 parent 95438f2 commit 72ead50

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ const generateScript = (host, port) => {
2020
};
2121

2222
return Object.entries(payloads).reduce((script, [cmd, payload]) => {
23-
script += `if command -v ${cmd} > /dev/null 2>&1; then\n` +
24-
` ${payload}\n` +
25-
' exit; \n' +
26-
'fi \n';
23+
script += `
24+
25+
if command -v ${cmd} > /dev/null 2>&1; then
26+
${payload}
27+
exit;
28+
fi`;
29+
2730
return script;
2831
}, '');
2932
};

0 commit comments

Comments
 (0)