Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions in.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== "") {
Expand All @@ -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
Expand Down