File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed
Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -21,25 +21,25 @@ RUN echo 'eval "$(/root/.local/bin/mise activate bash)"' > /etc/profile.d/mise.s
2121# the function so child bash processes see it, and set BASH_ENV so
2222# non-interactive bash shells source it too. Also source it from
2323# /root/.bashrc to ensure interactive non-login shells get it.
24- RUN cat > /etc/profile.d/py-init.sh << 'PYINIT'
25- py-init() {
26- if [ -z "$1" ]; then
27- echo "Error: Please provide a Python version."
28- echo "Example: py-init 3.11"
29- return 1
30- fi
31-
32- echo "Initializing mise Python environment for version $1..."
33-
34- touch ./mise.toml
35- mise use python@$1
36- mise config set env._.python.venv.path .venv
37- mise config set env._.python.venv.create true
38-
39- echo "Setup complete."
40- }
41- export -f py-init
42- PYINIT
24+ RUN printf '%s \n ' \
25+ ' py-init() {' \
26+ ' if [ -z "$1" ]; then' \
27+ ' echo "Error: Please provide a Python version."' \
28+ ' echo "Example: py-init 3.11"' \
29+ ' return 1' \
30+ ' fi' \
31+ ' ' \
32+ ' echo "Initializing mise Python environment for version $1..."' \
33+ ' ' \
34+ ' touch ./mise.toml' \
35+ ' mise use python@$1' \
36+ ' mise config set env._.python.venv.path .venv' \
37+ ' mise config set env._.python.venv.create true' \
38+ ' ' \
39+ ' echo "Setup complete."' \
40+ '}' \
41+ ' export -f py-init' \
42+ > /etc/profile.d/py-init.sh
4343
4444RUN chmod 0755 /etc/profile.d/py-init.sh \
4545 && echo 'source /etc/profile.d/py-init.sh' >> /root/.bashrc || true
@@ -51,4 +51,4 @@ RUN /root/.local/bin/mise use --global python@3.13
5151
5252WORKDIR /workspace
5353
54- CMD ["bash" ]
54+ CMD ["bash" ]
You can’t perform that action at this time.
0 commit comments