diff --git a/Dockerfile b/Dockerfile index 699e67c..086c852 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,12 @@ COPY out.js out COPY shared.js shared.js COPY package.json package.json -# TODO: Clean out cached data that apt generates. See how sonatype/nexus does it. -RUN apt-get update & \ - apt-get install subversion & \ +RUN apt-get update --yes && \ + apt-get install --yes \ + subversion \ + locales locales-all && \ + apt-get autoremove --yes && \ + apt-get clean --yes && \ npm install --quiet RUN chmod a+x check in out diff --git a/in.js b/in.js index 9eed83a..34001b1 100644 --- a/in.js +++ b/in.js @@ -67,7 +67,16 @@ process.stdin.on("data", stdin => { // TODO: urlencode cmdLine += ' "' + repository + '" .'; - exec(cmdLine, {cwd: destDir}, (err, stdout, stderr) => { + let options = { + cwd: destDir, + maxBuffer: 8192*1024, + env: { + LANG: "en_US.UTF-8", + LANGUAGE: "en_US:en", + LC_ALL: "en_US.UTF-8" + } + }; + exec(cmdLine, options, (err, stdout, stderr) => { // TODO: We can generate an incredible amount of output for large repos. // Stream this and check each line as it passes. if (stderr && stderr !== "") { @@ -92,7 +101,7 @@ process.stdin.on("data", stdin => { fail(new Error('unexpected svn output. expected revision, got "' + lines.slice(lines.length - 5).join("\n") + '"'), cmdLine); } - const rev = revLine.substr(header.length, revLine.length - header.length - 2); + const rev = revLine.substr(header.length, revLine.length - header.length - 1); success({ "version": { "revision": rev