From 62cbb2073922db98df380eacce0b620e1dda9877 Mon Sep 17 00:00:00 2001 From: Pierre Rousseau Date: Mon, 8 Jan 2024 12:17:46 +0000 Subject: [PATCH] [FIX] web: update jsconfig paths The jsconfig.json file is used by editors to provide autocompletion but the paths were not updated when it's used in the enterprise path. closes odoo/odoo#148725 X-original-commit: c41824c35f26708bece94a6bb507496a259172c0 Signed-off-by: Samuel Degueldre (sad) Signed-off-by: Pierre Rousseau (pro) --- addons/web/tooling/enable.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/tooling/enable.sh b/addons/web/tooling/enable.sh index 5996ca0eb06..941c2dd2431 100755 --- a/addons/web/tooling/enable.sh +++ b/addons/web/tooling/enable.sh @@ -16,6 +16,9 @@ enableInDir () { cp "$tooling/_jsconfig.json" jsconfig.json cp "$tooling/_package.json" package.json if [[ $2 == "copy" ]]; then + # -i is not supported on mac + sed "s@addons@$pathFromEnterpriseToCommunity/addons@g" jsconfig.json > tmp.json + mv tmp.json jsconfig.json # copy over node_modules and package-lock to avoid double "npm install" cp "$community/package-lock.json" package-lock.json cp -a "$community/node_modules" node_modules @@ -31,6 +34,7 @@ then read -p "What is the relative path from community to enterprise ? (../enterprise)" pathToEnterprise pathToEnterprise=${pathToEnterprise:-../enterprise} pathToEnterprise=$(realpath "$community/$pathToEnterprise") + pathFromEnterpriseToCommunity=$(realpath --relative-to="$pathToEnterprise" "$community") fi enableInDir "$community"