Browse Source

Move out routine to find sub-modules

Alois Mahdal 9 years ago
parent
commit
2bf4170cd7
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      src/bin/saturnin.skel

+ 10
- 2
src/bin/saturnin.skel View File

6
 # =====BEGIN BUILT PART=====
6
 # =====BEGIN BUILT PART=====
7
 #
7
 #
8
 
8
 
9
+inigrep_modules() {
10
+    #
11
+    # Find existing modules (ini.d sub-folders)
12
+    #
13
+    test -d "$1" || return 0
14
+    find -L "$1" -mindepth 1 -maxdepth 1 -type d
15
+}
16
+
9
 inigrep_paths() {
17
 inigrep_paths() {
10
     #
18
     #
11
     # Assemble list of config paths for FFOO_CONFIG_PATH (path per line)
19
     # Assemble list of config paths for FFOO_CONFIG_PATH (path per line)
18
     user="__SATURNIN_CONFIG_USER__"
26
     user="__SATURNIN_CONFIG_USER__"
19
     lcal="__SATURNIN_CONFIG_LOCAL__"
27
     lcal="__SATURNIN_CONFIG_LOCAL__"
20
     distd="__SATURNIN_SHARE__/ini.d"
28
     distd="__SATURNIN_SHARE__/ini.d"
21
-    test -d "$userd" && find -L "$userd" -mindepth 1 -maxdepth 1 -type d
29
+    inigrep_modules "$userd"
22
     echo "$user"
30
     echo "$user"
23
     echo "$lcal"
31
     echo "$lcal"
24
-    test -d "$distd" && find -L "$distd" -mindepth 1 -maxdepth 1 -type d
32
+    inigrep_modules "$distd"
25
 }
33
 }
26
 
34
 
27
 export FFOO_PATH FFOO_CONFIG_PATH SATURNIN_VERSION SATURNIN_CACHE_HOME
35
 export FFOO_PATH FFOO_CONFIG_PATH SATURNIN_VERSION SATURNIN_CACHE_HOME