Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Remove ignore scripts (nuxt requires it) (#1905)

sarayourfriend70199fb41b9b
diff --git a/Dockerfile b/Dockerfile
index a9932b0d0..d8b07cf33 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,9 +16,10 @@ RUN pnpm fetch
# copy the rest of the content
COPY --chown=node:node . /home/node/app
-# `--ignore-scripts` prevents the `prepare` script from running. This avoids
-# installation of pre-commit inside the container.
-RUN pnpm install -r --offline --ignore-scripts
+# Prevent pre-commit from being installed, we don't need it here and it fails to install anyway
+ENV SKIP_PRE_COMMIT=true
+
+RUN pnpm install -r --offline
# disable telemetry when building the app
ENV NUXT_TELEMETRY_DISABLED=1
diff --git a/bin/install-pre-commit.sh b/bin/install-pre-commit.sh
new file mode 100755
index 000000000..5f81820f9
--- /dev/null
+++ b/bin/install-pre-commit.sh
@@ -0,0 +1,11 @@
+#! /usr/bin/env sh
+
+set -e
+
+if [ -z "$SKIP_PRE_COMMIT" ]
+then
+ echo "installing pre-commit"
+ pnpm pc:download && pnpm pc:install
+else
+ echo "skipping pre-commit installation"
+fi
diff --git a/package.json b/package.json
index e73b7aa33..40f9ed008 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
"author": "sebworks",
"private": true,
"scripts": {
- "prepare": "pnpm pc:download && pnpm pc:install",
+ "prepare": "./bin/install-pre-commit.sh",
"predev": "pnpm install && pnpm i18n:no-get",
"dev": "pnpm dev:only",
"dev:only": "nuxt --hostname 0.0.0.0",