fix script change

This commit is contained in:
Eyal Posener 2019-11-24 00:42:07 +02:00
parent 85542e6d46
commit e8cb4f352f
3 changed files with 4 additions and 2 deletions

2
go.mod
View File

@ -2,7 +2,7 @@ module github.com/posener/complete/v2
require (
github.com/hashicorp/go-multierror v1.0.0
github.com/posener/script v1.0.1
github.com/posener/script v1.0.3
github.com/stretchr/testify v1.4.0
)

2
go.sum
View File

@ -12,6 +12,8 @@ github.com/posener/script v1.0.0 h1:/mJqplLNbKgJBeOElS00vDU9CG5QaN+qwp/o+lQAoDc=
github.com/posener/script v1.0.0/go.mod h1:Rg3ijooqulo05aGLyGsHoLmIOUzHUVK19WVgrYBPU/E=
github.com/posener/script v1.0.1 h1:MIYijfAGNnzPcH9zTFi+s8iiCgSfv90uTM5QnaSbajA=
github.com/posener/script v1.0.1/go.mod h1:Rg3ijooqulo05aGLyGsHoLmIOUzHUVK19WVgrYBPU/E=
github.com/posener/script v1.0.3 h1:RZczCsHvWDaqWzRguPDbOyiGx63LqbXg/evCKqBQkec=
github.com/posener/script v1.0.3/go.mod h1:Rg3ijooqulo05aGLyGsHoLmIOUzHUVK19WVgrYBPU/E=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=

View File

@ -27,7 +27,7 @@ func removeFromFile(path string, line string) error {
return fmt.Errorf("creating backup file: %s", err)
}
tmp, err := script.Cat(path).Modify(script.Grep{Re: regexp.MustCompile("^" + line + "$"), Invert: true}).ToTempFile()
tmp, err := script.Cat(path).Modify(script.Grep{Re: regexp.MustCompile("^" + line + "$"), Inverse: true}).ToTempFile()
if err != nil {
return fmt.Errorf("failed remove: %s", err)
}