Skip to content

Commit

Permalink
MarkdownBear: Set NODE_PATH for remark-lint
Browse files Browse the repository at this point in the history
remark-cli needs to find its plugins.  When invoked in `/coala-bears`
directory, Node automatically looks in `node_modules`.  However if
the docker image is used normally the working directory will not
be `/coala-bears`.  Setting NODE_PATH ensures that the plugins can
be found.

Related to coala/coala-bears#1235
  • Loading branch information
jayvdb committed Apr 19, 2017
1 parent 4992235 commit 3540ab3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ script:
bzr branch lp:govcstestbzrrepo;
hg clone https://bitbucket.org/fracai/empty-hg;
"
# Verify MarkdownBear works outside of coala-bears directory.
# See https://github.com/coala/coala-bears/issues/1235
- >
docker run -t -i coala-docker /bin/sh -c "
cd /tmp;
echo foo > foo.md;
coala --non-interactive --no-config --bears MarkdownBear --files foo.md;
"
- /bin/sh -c "! docker run coala-docker"
- docker run --volume=$(pwd)/.ci/sample:/work --workdir=/work coala-docker
- ls -la ./.ci/sample/.coafile
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ MAINTAINER Fabian Neuschmidt [email protected]
ARG branch=master

# Set the locale
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en PATH=$PATH:/root/pmd-bin-5.4.1/bin:/root/dart-sdk/bin:/coala-bears/node_modules/.bin:/root/bakalint-0.4.0:/root/elm-format-0.18
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
PATH=$PATH:/root/pmd-bin-5.4.1/bin:/root/dart-sdk/bin:/coala-bears/node_modules/.bin:/root/bakalint-0.4.0:/root/elm-format-0.18 \
NODE_PATH=/coala-bears/node_modules

# Create symlink for cache
RUN mkdir -p /root/.local/share/coala && \
Expand Down

0 comments on commit 3540ab3

Please sign in to comment.