//lex and parse all files, then link all
//
//input can be a dir or a file
lex and parse all files, then link all

input can be a dir or a file
// lex and parse all files then link all // // input can be a dir or a file
func Load(config string) error {
	if err := core.CheckEnv(); err != nil {
		return err
	}
	stat, err := os.Stat(os.ExpandEnv(config))
	if err != nil {
		return err
	}
	if !stat.IsDir() {
		if err := parseFile(config); err != nil {
			return err
		}
	} else {
		if err := filepath.Walk(config, func(path string, info os.FileInfo, err error) error {
			if info == nil {
				return err
			}
			if info.IsDir() {
				return err
			}
			if filepath.Ext(path) == ".yaml" {
				return parseFile(path)
			}
			return nil
		}); err != nil {
			return err
		}
	}
	if err := Link(); err != nil {
		return err
	}
	return nil
}
func Load ( config string ) error { if err := core . CheckEnv ( ) ; err != nil { return err } stat , err := os . Stat ( os . ExpandEnv ( config ) ) if err != nil { return err } if ! stat . IsDir ( ) { if err := parseFile ( config ) ; err != nil { return err } } else { if err := filepath . Walk ( config , func ( path string , info os . FileInfo , err error ) error { if info == nil { return err } if info . IsDir ( ) { return err } if filepath . Ext ( path ) == " " { return parseFile ( path ) } return nil } ) ; err != nil { return err } } if err := Link ( ) ; err != nil { return err } return nil }
lex and parse all files, then link all
lex and parse all files then link all
//is file //dir