Merge pull request #239555 from Ma27/workaround-discourse-assets-issue

discourse.assets: work around `cannot execute: required file not found`

authored by

Maximilian Bosch and committed by
GitHub
f6de65f7 ba7cf6a4

+13
+13
pkgs/servers/web-apps/discourse/default.nix
··· 39 39 , nodePackages 40 40 , nodejs_16 41 41 , dart-sass-embedded 42 + , jq 43 + , moreutils 42 44 43 45 , plugins ? [] 44 46 }@args: ··· 225 227 nodePackages.patch-package 226 228 yarn 227 229 nodejs_16 230 + jq 231 + moreutils 228 232 ]; 229 233 230 234 outputs = [ "out" "javascripts" ]; ··· 266 270 267 271 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 268 272 273 + find app/assets/javascripts -name package.json -print0 \ 274 + | xargs -0 -I {} bash -c "jq 'del(.scripts.postinstall)' -r <{} | sponge {}" 269 275 yarn install --offline --cwd app/assets/javascripts/discourse 270 276 271 277 patchShebangs app/assets/javascripts/node_modules/ 278 + 279 + # Run `patch-package` AFTER the corresponding shebang inside `.bin/patch-package` 280 + # got patched. Otherwise this will fail with 281 + # /bin/sh: line 1: /build/source/app/assets/javascripts/node_modules/.bin/patch-package: cannot execute: required file not found 282 + pushd app/assets/javascripts &>/dev/null 283 + yarn run patch-package 284 + popd &>/dev/null 272 285 273 286 redis-server >/dev/null & 274 287