Skip to content

Commit

Permalink
Use quotes for readal execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Sep 7, 2022
1 parent 1127a69 commit c71c0f9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ async function execProcess(binaryPath, args) {
// Function to get an alignment format with readal
async function readalGetFormat(alignmentPath) {
const readalPath = path.resolve(binaryDir, 'readal');
//TODO: Wrap readalPath in quotes?!
const childCmd = `${readalPath} -in ${alignmentPath} -type -format`;
const childCmd = `${quote(readalPath)} -in ${quote(alignmentPath)} -type -format`;
const { stdout, stderr } = await exec(childCmd, {
shell: is.windows,
});
Expand All @@ -557,8 +556,7 @@ async function readalGetFormat(alignmentPath) {
async function convertAlignment(alignmentPath) {
const readalPath = path.resolve(binaryDir, 'readal');
const newPath = alignmentPath.replace(path.extname(alignmentPath), '.fas');
//TODO: Wrap readalPath in quotes?!
const childCmd = `${readalPath} -in ${alignmentPath} -out ${newPath} -fasta`;
const childCmd = `${quote(readalPath)} -in ${quote(alignmentPath)} -out ${quote(newPath)} -fasta`;
const { stdout, stderr } = await exec(childCmd, {
shell: is.windows,
});
Expand Down

0 comments on commit c71c0f9

Please sign in to comment.