Merge pull request #239555 from Ma27/workaround-discourse-assets-issue
discourse.assets: work around `cannot execute: required file not found`
This commit is contained in:
commit
f6de65f785
1 changed files with 13 additions and 0 deletions
|
@ -39,6 +39,8 @@
|
||||||
, nodePackages
|
, nodePackages
|
||||||
, nodejs_16
|
, nodejs_16
|
||||||
, dart-sass-embedded
|
, dart-sass-embedded
|
||||||
|
, jq
|
||||||
|
, moreutils
|
||||||
|
|
||||||
, plugins ? []
|
, plugins ? []
|
||||||
}@args:
|
}@args:
|
||||||
|
@ -225,6 +227,8 @@ let
|
||||||
nodePackages.patch-package
|
nodePackages.patch-package
|
||||||
yarn
|
yarn
|
||||||
nodejs_16
|
nodejs_16
|
||||||
|
jq
|
||||||
|
moreutils
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs = [ "out" "javascripts" ];
|
outputs = [ "out" "javascripts" ];
|
||||||
|
@ -266,10 +270,19 @@ let
|
||||||
|
|
||||||
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
||||||
|
|
||||||
|
find app/assets/javascripts -name package.json -print0 \
|
||||||
|
| xargs -0 -I {} bash -c "jq 'del(.scripts.postinstall)' -r <{} | sponge {}"
|
||||||
yarn install --offline --cwd app/assets/javascripts/discourse
|
yarn install --offline --cwd app/assets/javascripts/discourse
|
||||||
|
|
||||||
patchShebangs app/assets/javascripts/node_modules/
|
patchShebangs app/assets/javascripts/node_modules/
|
||||||
|
|
||||||
|
# Run `patch-package` AFTER the corresponding shebang inside `.bin/patch-package`
|
||||||
|
# got patched. Otherwise this will fail with
|
||||||
|
# /bin/sh: line 1: /build/source/app/assets/javascripts/node_modules/.bin/patch-package: cannot execute: required file not found
|
||||||
|
pushd app/assets/javascripts &>/dev/null
|
||||||
|
yarn run patch-package
|
||||||
|
popd &>/dev/null
|
||||||
|
|
||||||
redis-server >/dev/null &
|
redis-server >/dev/null &
|
||||||
|
|
||||||
initdb -A trust $NIX_BUILD_TOP/postgres >/dev/null
|
initdb -A trust $NIX_BUILD_TOP/postgres >/dev/null
|
||||||
|
|
Loading…
Reference in a new issue