Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] web: fix tooling failing to run due to bash-specific syntax
In #86163 we added a check on the branch name to avoid running the tooling on stable branches, however this check used bash-specific syntax. While the hashbang in the pre-commit hook specifies that the hook should be run using bash, we were using the npm module "husky" to manage git hooks, which would ignore this hashbang and always run the hook using sh, causing the hook to fail in all cases. After some consideration, we have decided to stop using husky, as its main purpose is to make hook management easier in npm-based projects. Since we already need a script to enable the tooling, we can do essentially the same thing that husky is doing but with more control over the process with no drawbacks. closes #86888 Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
- Loading branch information
1 parent
d9bc8dd
commit 3104ab1
Showing
7 changed files
with
40 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
addons/web/tooling/_husky/pre-commit → addons/web/tooling/hooks/pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/bin/bash | ||
community=$(cd -- "$(dirname "$0")" &> /dev/null && cd ../../.. && pwd) | ||
|
||
script="$0" | ||
basename="$(dirname "$script")" | ||
|
||
"$basename/disable.sh" | ||
"$basename/enable.sh" | ||
"$community/addons/web/tooling/disable.sh" | ||
"$community/addons/web/tooling/enable.sh" |