Symlink static assets in sites/assets/<app>/

This commit is contained in:
Akshay Mankar 2023-06-02 18:16:34 +02:00
parent f564435084
commit 59249c421d
Signed by untrusted user: axeman
GPG key ID: CA08F3AB62369B89

View file

@ -47,8 +47,7 @@ let
frappeApp = mkApp "frappe" frappeSrc frappeOfflineCache;
erpnextApp = mkApp "erpnext" erpnextSrc erpnextOfflineCache;
assets = runCommand "frappe-erpnext-assets" {buildInputs = [yarn]; } ''
in runCommand "frappe-erpnext-apps-sites" {buildInputs = [yarn]; } ''
mkdir -p $out/share/sites $out/share/apps
# Cannot symlink because the code which traverses path to find sites
@ -62,7 +61,12 @@ let
EOF
cd $out/share/apps/frappe
pwd
yarn --offline production
'';
in assets
symlinkPublic() {
find $out/share/apps/$1/$1/public -type d -mindepth 1 -maxdepth 1 | xargs -I '{}' bash -c "ln -s {} $out/share/sites/assets/$1/"'$(basename {})'
}
symlinkPublic frappe
symlinkPublic erpnext
''