Files
odoo_source/addons/web/tooling/disable.sh
T
Simon Genin (ges) 9583c74e5f [FIX] web: make js tooling safe with paths with spaces
If $basepath in the tooling contained spaces, it could have dramatic
consequences on the rm -rf command.
We simply escape everything to avoid the problem.

closes odoo/odoo#73222

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-05 13:07:48 +00:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
script="$0"
basename="$(dirname "$script")"
read -p "Do you want to delete the tooling installed in enterprise too ? [y, n]" willingToDeleteToolingInEnterprise
if [[ $willingToDeleteToolingInEnterprise != "n" ]]
then
read -p "What is the relative path from community to enterprise ? (../enterprise)" pathToEnterprise
pathToEnterprise=${pathToEnterprise:-../enterprise}
fi
rm -rf "$basename/../../../.husky"
rm -rf "$basename/../../../.eslintignore"
rm -rf "$basename/../../../.prettierignore"
rm -rf "$basename/../../../.eslintrc.json"
rm -rf "$basename/../../../.prettierrc.json"
rm -rf "$basename/../../../package.json"
rm -rf "$basename/../../../package-lock.json"
rm -rf "$basename/../../../node_modules"
if [[ $willingToDeleteToolingInEnterprise != "n" ]]
then
rm -rf "$basename/../../../$pathToEnterprise/.husky"
rm -rf "$basename/../../../$pathToEnterprise/.eslintignore"
rm -rf "$basename/../../../$pathToEnterprise/.prettierignore"
rm -rf "$basename/../../../$pathToEnterprise/.eslintrc.json"
rm -rf "$basename/../../../$pathToEnterprise/.prettierrc.json"
rm -rf "$basename/../../../$pathToEnterprise/package.json"
rm -rf "$basename/../../../$pathToEnterprise/package-lock.json"
rm -rf "$basename/../../../$pathToEnterprise/node_modules"
fi
echo ""
echo "JS tooling have been removed from the roots"
echo ""