Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken file extensions in paths (#47)
Before this change when running go-licenser with the `-exclude` flag pointing to a file, the exclusion rule would never work. When walking the directory `currentPath` was always losing the first `.` which corrupted file extensions. For example, ``` ./go-licenser -exclude "pkg/proto/messages/struct.pb.go" -license "Elastic" -ext ".go" ``` was always replacing the license header in `pkg/proto/messages/struct.pb.go` because while walking the `currentPath` would become `pkg/proto/messages/structpb.go`. After this change `currentPath` is trimmed from the start only.
- Loading branch information