Outside of `.pulumiignore` we support a few "default" excludes that try to push folks towards a pit of succes. Previously, there was no way to opt out of these, which would be bad if our huristics caused something youto really care about to be elided. With this change, we add an optional setting in Pulumi.yaml that allows you to opt out of this behavior. As part of the work, I changed .git to be one of these "default" excludes instead of it only happening if you had a .pulumiignore file in a directory
28 lines
487 B
Go
28 lines
487 B
Go
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
|
|
|
|
package archive
|
|
|
|
type ignorer interface {
|
|
IsIgnored(f string) bool
|
|
}
|
|
|
|
type ignoreState struct {
|
|
ignorer ignorer
|
|
next *ignoreState
|
|
}
|
|
|
|
func (s *ignoreState) Append(ignorer ignorer) *ignoreState {
|
|
return &ignoreState{ignorer: ignorer, next: s}
|
|
}
|
|
|
|
func (s *ignoreState) IsIgnored(path string) bool {
|
|
if s == nil {
|
|
return false
|
|
}
|
|
|
|
if s.ignorer.IsIgnored(path) {
|
|
return true
|
|
}
|
|
|
|
return s.next.IsIgnored(path)
|
|
}
|