shithub: werc

ref: fc5b6f571e8bf3239a88e023b9f22a6470b19230
dir: /bin/wercconf.rc/

View raw version
# To be used from config files
fn conf_perm_redirect {
    if(~ $#* 1)
        perm_redir_to=$1
    if not {
        perm_redir_patterns=($perm_redir_patterns $1 $2)
        conf_hide_paths $1 # XXX Will hide paths even if replacement string is the same as matched sctring.
    }
}

fn conf_hide_paths {
    for(i in $*)
       dirfilter=$dirfilter^'/'^`{echo $sitedir'/'$i|sed 's!/+!\\/!g'}^'/d; '
}

# Usually will be called from within conf_enable_foo 
fn conf_enable_app {
    # Note: maybe we should add test -d apps/$1/?
    if(! ~ $1 $enabled_apps)
	enabled_apps=( $enabled_apps $1 )
}