diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-01-16 15:10:05 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-01-16 15:14:06 (EST) |
commit | c0c320617f580e1bfa5aebca72ec5aeed3276fcf (patch) | |
tree | 37c2b46ff7da947b9a2a2543279aebefc21e3cda /src/profile.sh | |
parent | f38763638d294f38e0b177c28b580e0d6325a16e (diff) |
profile_detect(): New function
Diffstat (limited to 'src/profile.sh')
-rw-r--r-- | src/profile.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/profile.sh b/src/profile.sh index 9bbd9ce..44e3022 100644 --- a/src/profile.sh +++ b/src/profile.sh @@ -50,6 +50,20 @@ profile_set() return 0 } +profile_detect() +{ + local root="${1}" + + for prof in ${profiles}; do + if "prof_${prof}_detect_root" "${root}"; then + profile="${prof}" + return 0 + fi + done + + error 1 "$(get_msg 'profile_not_detected')" "${root}" +} + profile_normalize_suite() { local suite="${1}" |