Put ${REPO_PATH}/.local/bin in PATH too

pull/507/head
yuvipanda 2018-12-18 11:39:21 -08:00
rodzic 21154d3b86
commit 29407aa83f
2 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -102,6 +102,16 @@ ARG REPO_DIR=${HOME}
ENV REPO_DIR ${REPO_DIR}
WORKDIR ${REPO_DIR}
# We want to allow two things:
# 1. If there's a .local/bin directory in the repo, things there
# should automatically be in path
# 2. postBuild and users should be able to install things into ~/.local/bin
# and have them be automatically in path
#
# The XDG standard suggests ~/.local/bin as the path for local user-specific
# installs. See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
ENV PATH ${HOME}/.local/bin:${REPO_DIR}/.local/bin:${PATH}
# Copy and chown stuff. This doubles the size of the repo, because
# you can't actually copy as USER, only as root! Thanks, Docker!
USER root
@ -243,10 +253,7 @@ class BuildPack:
Just sets the PATH environment variable. Separated out since
it is very commonly set by various buildpacks.
"""
# Allow local user installs into ~/.local, which is where the
# XDG desktop standard suggests these should be
# See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
return ['$HOME/.local/bin']
return []
def get_labels(self):
"""

Wyświetl plik

@ -1,5 +1,7 @@
#!/usr/bin/env python
# Verify that ~/.local/bin is on the PATH
# Verify that ~/.local/bin & REPO_DIR/.local/bin is on the PATH
import os
assert os.path.expanduser('~/.local/bin') in os.getenv("PATH"), os.getenv("PATH")
assert os.getcwd() == os.environ['REPO_DIR']
assert '{}/.local/bin'.format(os.environ['REPO_DIR']) in os.getenv('PATH')