Skip to content

Commit

Permalink
address comment, check plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
lysu committed Jan 13, 2019
1 parent a42f8e9 commit 5bbc246
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/pluginpkg/pluginpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os/exec"
"path"
"path/filepath"
"strings"
"text/template"
"time"

Expand Down Expand Up @@ -98,6 +99,10 @@ func main() {
manifest["buildTime"] = time.Now().String()

pluginName := manifest["name"].(string)
if strings.Contains(pluginName, "-") {
log.Printf("plugin name should not contain '-'\n")
os.Exit(1)
}
if pluginName != filepath.Base(pkgDir) {
log.Printf("plugin package must be same with plugin name in manifest file\n")
os.Exit(1)
Expand Down

0 comments on commit 5bbc246

Please sign in to comment.