Skip to content

Commit cb27b23

Browse files
committed
Add newline to pipeline stdin for POSIX compliance
See #568
1 parent 6f1be02 commit cb27b23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/server/src/scan-controller.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ class ScanController {
8383

8484
// Apply filters
8585
if (this.request.filters.length > 0) {
86-
const stdin = files.map(f => f.name).join('\n');
86+
const stdin = files.map(f => `${f.name}\n`).join('');
8787
const cmd = `convert @- ${application.filterBuilder().build(this.request.filters)} f-%04d.tif`;
8888
await Process.spawn(cmd, stdin, { cwd: config.tempDirectory });
8989
files = (await this.listFiles()).filter(f => f.name.match(/f-\d{4}\.tif/));
9090
}
9191

92-
const stdin = files.map(f => f.name).join('\n');
92+
const stdin = files.map(f => `${f.name}\n`).join('');
9393
log.debug('Executing cmds:', this.pipeline.commands);
9494
const stdout = await Process.chain(this.pipeline.commands, stdin, { cwd: config.tempDirectory });
9595
let filenames = stdout.toString().split('\n').filter(f => f.length > 0);

0 commit comments

Comments
 (0)