bw-dev: drop use of npm exec by setting PATH in Docker image

This commit is contained in:
Adeodato Simó 2023-10-18 18:52:39 -03:00
parent 6392a8e01d
commit b78d51410b
No known key found for this signature in database
GPG key ID: CDF447845F1A986F
2 changed files with 9 additions and 14 deletions

22
bw-dev
View file

@ -188,31 +188,25 @@ case "$CMD" in
;;
prettier)
prod_error
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- prettier \
--write bookwyrm/static/js/*.js
$DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js
;;
eslint)
prod_error
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix devtools -- eslint \
bookwyrm/static --ext .js
$DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js
;;
stylelint)
prod_error
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- stylelint --fix \
--config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \
bookwyrm/static/css
$DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \
--config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore
;;
formatters)
prod_error
runweb pylint bookwyrm/
$DOCKER_COMPOSE run --rm dev-tools black celerywyrm bookwyrm
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- prettier \
--write bookwyrm/static/js/*.js
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix devtools -- eslint \
bookwyrm/static --ext .js
$DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- stylelint --fix \
--config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \
bookwyrm/static/css
$DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js
$DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js
$DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \
--config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore
;;
mypy)
prod_error

View file

@ -1,6 +1,7 @@
FROM python:3.9
WORKDIR /app/dev-tools
ENV PATH="/app/dev-tools/node_modules/.bin:$PATH"
ENV PYTHONUNBUFFERED=1
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1