add git clone
This commit is contained in:
@@ -2,6 +2,8 @@ package schema
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
@@ -10,6 +12,11 @@ import (
|
||||
|
||||
type CharSchemaPluginName string
|
||||
|
||||
func (cspn CharSchemaPluginName) Hash() string {
|
||||
bytes := sha256.Sum256([]byte(cspn))
|
||||
return hex.EncodeToString(bytes[:])
|
||||
}
|
||||
|
||||
type PluginOps struct {
|
||||
Org string
|
||||
RepositoryName string
|
||||
|
@@ -55,16 +55,16 @@ func TestGetPlugins(t *testing.T) {
|
||||
input: `
|
||||
registry: git.front.kjuulh.io
|
||||
plugins:
|
||||
"kjuulh/char#plugins/gocli": {}
|
||||
"kjuulh/char#plugins/gocli@v1.9.0": {}
|
||||
"kjuulh/char#plugins/rust": {}
|
||||
`,
|
||||
expected: map[schema.CharSchemaPluginName]*schema.CharSchemaPlugin{
|
||||
"kjuulh/char#plugins/gocli": {
|
||||
"kjuulh/char#plugins/gocli@v1.9.0": {
|
||||
Opts: &schema.PluginOps{
|
||||
Org: "kjuulh",
|
||||
RepositoryName: "char",
|
||||
Path: "plugins/gocli",
|
||||
Version: "",
|
||||
Version: "v1.9.0",
|
||||
},
|
||||
},
|
||||
"kjuulh/char#plugins/rust": {
|
||||
|
Reference in New Issue
Block a user