Skip to content

Commit

Permalink
Add newline to pipeline stdin for POSIX compliance
Browse files Browse the repository at this point in the history
 See #568
  • Loading branch information
sbs20 committed Feb 28, 2023
1 parent 6f1be02 commit cb27b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/scan-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ class ScanController {

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

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

0 comments on commit cb27b23

Please sign in to comment.