Skip to content

Commit e93ada4

Browse files
committed
Dockerfile: ensure schema/latest is a real dir and copy JSON files (fix Windows symlink in CI)
1 parent 3d01942 commit e93ada4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ COPY package.json ./
4343
# and any `src/schema` used during development.
4444
COPY schema ./schema
4545
COPY src/schema ./src/schema
46-
# Ensure schema/latest is available under src/schema/latest so imports from
47-
# `src/...` using `../schema/latest/...` resolve correctly during the build
48-
RUN if [ -d schema/latest ]; then \
49-
mkdir -p src/schema/latest && cp -r schema/latest/* src/schema/latest/; \
50-
fi
46+
# Ensure `schema/latest` is a real directory with JSON files.
47+
# In some checkouts (Windows or sparse CI setups) `schema/latest` can be a
48+
# symlink that points to a host path like `D:/...` which is not readable inside
49+
# the Linux build container. Remove such symlink, create a proper directory,
50+
# and populate it from the files we have under `src/schema` so imports like
51+
# `../schema/latest/app-scripting.schema.json` resolve correctly.
52+
RUN if [ -L schema/latest ]; then rm -f schema/latest; fi && \
53+
mkdir -p schema/latest && \
54+
cp -a src/schema/*.json schema/latest/ || true && \
55+
mkdir -p src/schema/latest && cp -a src/schema/*.json src/schema/latest/ || true
5156

5257
# Remove Windows-specific Rollup package and install dependencies
5358
RUN npm pkg delete devDependencies.@rollup/rollup-win32-x64-msvc && \

0 commit comments

Comments
 (0)