@@ -65,57 +65,21 @@ source "$OMAFORGE_INSTALL/helpers/all.sh"
6565# Function to run a single module
6666run_single_module () {
6767 local module=" $1 "
68- local module_path=" "
6968
70- # Try to find the module file
71- # First, check if it's a direct path
72- if [[ -f " $OMAFORGE_INSTALL /$module .sh" ]]; then
73- module_path=" $OMAFORGE_INSTALL /$module .sh"
74- # Try with .sh extension if not already present
75- elif [[ -f " $OMAFORGE_INSTALL /${module% .sh} .sh" ]]; then
76- module_path=" $OMAFORGE_INSTALL /${module% .sh} .sh"
77- # Search for common short names
78- else
79- # Common module locations
80- local search_paths=(
81- " config/hardware/$module .sh"
82- " config/$module .sh"
83- " packaging/$module .sh"
84- " repositories/$module .sh"
85- " dotfiles/$module .sh"
86- " preflight/$module .sh"
87- " post-install/$module .sh"
88- )
69+ # Add .sh if not present
70+ [[ " $module " != * .sh ]] && module=" $module .sh"
8971
90- for path in " ${search_paths[@]} " ; do
91- if [[ -f " $OMAFORGE_INSTALL /$path " ]]; then
92- module_path=" $OMAFORGE_INSTALL /$path "
93- break
94- fi
95- done
96- fi
72+ # Find the module file
73+ local module_path=$( find " $OMAFORGE_INSTALL " -name " $module " -type f | head -1)
9774
9875 if [[ -z " $module_path " ]]; then
9976 echo " [ERROR] Module not found: $module "
100- echo " [ERROR] Searched in common locations but couldn't find the module file"
101- echo " "
102- echo " Available modules:"
103- echo " Hardware: asus, nvidia"
104- echo " Config: system, git, firmware, multimedia, performance, services, nextdns, secureboot"
105- echo " Packaging: base, flatpak, rust, bloatware, webapps"
106- echo " Repositories: rpmfusion, copr, terra, external"
107- echo " Dotfiles: zsh, fonts, directories, stow"
10877 exit 1
10978 fi
11079
111- echo " [INFO] Running single module: $( basename " $module_path " ) "
112- echo " [INFO] Path: $module_path "
113- echo " "
114-
80+ echo " [INFO] Running: $module_path "
11581 source " $module_path "
116-
117- echo " "
118- echo " [SUCCESS] Module completed: $( basename " $module_path " ) "
82+ echo " [SUCCESS] Completed"
11983}
12084
12185# Check if running single module or full setup
0 commit comments