Skip to content

Commit 28e7e2a

Browse files
committed
fix: strengthen module validation
1 parent 4263fe5 commit 28e7e2a

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

scripts/validate-module.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ need_dir() {
1616
[ -d "$dir" ] || error_exit "Missing folder: $dir"
1717
}
1818

19+
check_shell() {
20+
local file="$1"
21+
bash -n "$file" || error_exit "Shell syntax failed: $file"
22+
}
23+
24+
check_json() {
25+
local file="$1"
26+
python3 -m json.tool "$file" >/dev/null || error_exit "JSON syntax failed: $file"
27+
}
28+
1929
echo "Validating module files"
2030

2131
need_file "module.prop"
@@ -28,6 +38,10 @@ need_file "scripts/check-theme-size.sh"
2838
need_file "themes/default/theme.json"
2939
need_file "themes/default/design-tokens.json"
3040
need_file "customer-options/options.json"
41+
need_file "docs/DEFAULT_THEME_CUSTOMER_GUIDE.md"
42+
need_file "docs/LAG_FIX_GUIDE.md"
43+
need_file "docs/UI_DESIGN_SYSTEM.md"
44+
need_file "docs/PROBLEM_SOLVER_MATRIX.md"
3145

3246
need_dir "system_ext/media/themeInner"
3347
need_dir "themes/default/wallpapers"
@@ -41,5 +55,17 @@ need_dir "docs"
4155
grep -q "id=coloros_themes_rock" module.prop || error_exit "Wrong module id"
4256
grep -q "ColorOS Themes Rock" module.prop || error_exit "Module name missing"
4357
grep -q "Default Rock Premium" themes/default/theme.json || error_exit "Default theme missing"
58+
grep -q "default_theme" customer-options/options.json || error_exit "Default theme option missing"
59+
60+
check_shell "customize.sh"
61+
check_shell "post-fs-data.sh"
62+
check_shell "service.sh"
63+
check_shell "uninstall.sh"
64+
check_shell "scripts/package.sh"
65+
check_shell "scripts/check-theme-size.sh"
66+
67+
check_json "themes/default/theme.json"
68+
check_json "themes/default/design-tokens.json"
69+
check_json "customer-options/options.json"
4470

4571
echo "Module validation passed"

0 commit comments

Comments
 (0)