grim/govcs

Add all the licenses
draft
2017-12-05, Gary Kramlich
8e90bec41d16
Add all the licenses
/*
* govcs
* Copyright 2017 Gary Kramlich <grim@reaperworld.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package govcs
import (
"bitbucket.org/rw_grim/govcs/git"
"bitbucket.org/rw_grim/govcs/hg"
"bitbucket.org/rw_grim/govcs/vcs"
)
type Detector func(wd string) vcs.VCS
var (
detectors = []Detector{
git.Detect,
hg.Detect,
}
)
func Detect(wd string) vcs.VCS {
for _, detector := range detectors {
inst := detector(wd)
if inst != nil {
return inst
}
}
return nil
}