From ccfbdd7aea9dff6a7085dd79047acb5b47b3ab64 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 15 Oct 2016 12:41:40 +0100 Subject: [PATCH] Let potomo assume msgfmt is on the path There's no need to second-guess install locations. --- appveyor.yml | 1 + scripts/potomo.js | 21 +-------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5dff3a17..2b74d36a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,6 +42,7 @@ test_script: after_test: - cd %APPVEYOR_BUILD_FOLDER% - C:\Python27\Scripts\sphinx-build -b html docs build\docs\html + - set PATH=%PATH%;C:\cygwin\bin\ - node scripts\potomo.js - node scripts\archive.js # AppVeyor checks out a specific commit, but that means the archive script diff --git a/scripts/potomo.js b/scripts/potomo.js index f76a03d0..1ad999ea 100644 --- a/scripts/potomo.js +++ b/scripts/potomo.js @@ -7,25 +7,6 @@ const fs = require('fs'); const path = require('path'); const helpers = require('./helpers'); -function getMsgfmtPath() { - const paths = [ - path.join('C:\\', 'Program Files (x86)', 'Poedit', 'GettextTools', 'bin', 'msgfmt.exe'), - path.join('C:\\', 'cygwin', 'bin', 'msgfmt.exe'), - path.join('/', 'usr', 'bin', 'msgfmt'), - ]; - - for (let i = 0; i < paths.length; i += 1) { - if (helpers.fileExists(paths[i])) { - return paths[i]; - } - } - - throw new Error('No msgfmt.exe found!'); -} - -/* This isn't portable to Linux but it doesn't (yet?) need to be. */ -const msgfmtPath = getMsgfmtPath(); - let rootPath = '.'; if (process.argv.length > 2) { rootPath = process.argv[2]; @@ -40,7 +21,7 @@ fs.readdirSync(l10nPath).forEach((file) => { fs.accessSync(poPath, fs.R_OK); - childProcess.execFileSync(msgfmtPath, [ + childProcess.execFileSync('msgfmt', [ poPath, '-o', moPath,