예제 #1
0
파일: app_files.go 프로젝트: nsnt/cli
func exclusionsForPattern(cfignorePattern string) (exclusions Globs) {
	exclusions = append(exclusions, glob.MustCompileGlob(cfignorePattern))
	exclusions = append(exclusions, glob.MustCompileGlob(path.Join(cfignorePattern, "*")))
	exclusions = append(exclusions, glob.MustCompileGlob(path.Join(cfignorePattern, "**", "*")))

	if !strings.HasPrefix(cfignorePattern, "/") {
		exclusions = append(exclusions, glob.MustCompileGlob(path.Join("**", cfignorePattern)))
		exclusions = append(exclusions, glob.MustCompileGlob(path.Join("**", cfignorePattern, "*")))
		exclusions = append(exclusions, glob.MustCompileGlob(path.Join("**", cfignorePattern, "**", "*")))
	}
	return
}
예제 #2
0
파일: cf_ignore.go 프로젝트: nota-ja/cli
func globsForPattern(pattern string) (globs []glob.Glob) {
	globs = append(globs, glob.MustCompileGlob(pattern))
	globs = append(globs, glob.MustCompileGlob(path.Join(pattern, "*")))
	globs = append(globs, glob.MustCompileGlob(path.Join(pattern, "**", "*")))

	if !strings.HasPrefix(pattern, "/") {
		globs = append(globs, glob.MustCompileGlob(path.Join("**", pattern)))
		globs = append(globs, glob.MustCompileGlob(path.Join("**", pattern, "*")))
		globs = append(globs, glob.MustCompileGlob(path.Join("**", pattern, "**", "*")))
	}

	return
}