Skip to content

Commit

Permalink
Pull xls2xform executable name into a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jun 11, 2017
1 parent e95c45b commit 0ee755a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/convert-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const fs = require('../lib/sync-fs');
const info = require('../lib/log').info;
const trace = require('../lib/log').trace;

const XLS2XFORM = 'xls2xform-medic';

module.exports = (project, subDirectory, options) => {
if(!options) options = {};

Expand Down Expand Up @@ -35,7 +37,7 @@ module.exports = (project, subDirectory, options) => {
};

const xls2xform = (sourcePath, targetPath) =>
exec('xls2xform-medic', sourcePath, targetPath)
exec(XLS2XFORM, sourcePath, targetPath)
.catch(e => {
if(!executableAvailable()) {
error('There was a problem executing xls2xform. It may not be installed. To install, run ' + require('../cli/xls2xform-installation-command'));
Expand Down Expand Up @@ -69,7 +71,7 @@ const fixXml = path => {

function executableAvailable() {
try {
execSync('xls2xform-medic -h', {
execSync(`${XLS2XFORM} -h`, {
stdio: ['ignore', 'ignore', 'ignore'],
});
return true;
Expand Down

0 comments on commit 0ee755a

Please sign in to comment.