Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 3c16964

Browse files
committed
Remove usage of $HOME
refs #61
1 parent 56916e4 commit 3c16964

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ RUN apt-get update && apt-get install -y \
2121
&& rm -rf /var/lib/apt/lists/*
2222

2323
# nvm
24-
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
25-
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> "$HOME/.bashrc" \
24+
ENV NVM_DIR /opt/.nvm
25+
RUN mkdir -p /opt/.nvm && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
26+
RUN echo 'export NVM_DIR="/opt/.nvm"' >> "$HOME/.bashrc" \
2627
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$HOME/.bashrc"
2728

2829
# nodejs and tools
29-
RUN bash -c "source $HOME/.nvm/nvm.sh \
30+
RUN bash -c "source /opt/.nvm/nvm.sh \
3031
&& nvm install 10 \
3132
&& nvm install 12 \
3233
&& nvm install 14 \
@@ -37,12 +38,12 @@ WORKDIR "/skill"
3738

3839
COPY package.json package-lock.json ./
3940

40-
RUN bash -c "source $HOME/.nvm/nvm.sh \
41+
RUN bash -c "source /opt/.nvm/nvm.sh \
4142
&& npm ci --no-optional \
4243
&& npm cache clean --force"
4344

4445
COPY --from=build /usr/src/ .
4546

4647
WORKDIR "/atm/home"
4748

48-
ENTRYPOINT ["bash", "-c", "source $HOME/.nvm/nvm.sh && node --no-deprecation --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=512 /skill/node_modules/.bin/atm-skill run"]
49+
ENTRYPOINT ["bash", "-c", "source /opt/.nvm/nvm.sh && node --no-deprecation --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=512 /skill/node_modules/.bin/atm-skill run"]

lib/events.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const SetupNodeStep: NpmStep = {
172172
// Set up node version
173173
let result = await params.project.spawn("bash", [
174174
"-c",
175-
`source $HOME/.nvm/nvm.sh && nvm install ${cfg.version}`,
175+
`source /opt/.nvm/nvm.sh && nvm install ${cfg.version}`,
176176
]);
177177
if (result.status !== 0) {
178178
await params.check.update({
@@ -188,13 +188,13 @@ const SetupNodeStep: NpmStep = {
188188
// set the unsafe-prem config
189189
await params.project.spawn("bash", [
190190
"-c",
191-
`source $HOME/.nvm/nvm.sh && npm config set unsafe-perm true`,
191+
`source /opt/.nvm/nvm.sh && npm config set unsafe-perm true`,
192192
]);
193193

194194
const captureLog = childProcess.captureLog();
195195
result = await params.project.spawn(
196196
"bash",
197-
["-c", `source $HOME/.nvm/nvm.sh && nvm which ${cfg.version}`],
197+
["-c", `source /opt/.nvm/nvm.sh && nvm which ${cfg.version}`],
198198
{
199199
log: captureLog,
200200
logCommand: false,

0 commit comments

Comments
 (0)