Skip to content

Commit

Permalink
Refactor convert format
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Feb 25, 2017
1 parent a2c7292 commit 4c4c2d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ const convert = ({ files, outputPath, outputType, name }) => {
execS('which convert', (error) => {
if (error) reject(error)

const fileString = files.map(replaceSpaceCharacters).join(' ')
const outputName = name || `ALCHEMY-${concatFiles(files)}.${outputType || 'pdf'}`
const command = `convert ${fileString} ${outputPath}${outputName}`
const command = [
'convert',
...files.map(replaceSpaceCharacters), // input files
outputPath + outputName
].join(' ')

console.log(command)

execS(command, (error) => {
Expand Down

0 comments on commit 4c4c2d6

Please sign in to comment.