diff --git a/README.md b/README.md index e7c2670..1b799cd 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ brew upgrade git-scope curl -sSL https://raw.githubusercontent.com/Bharath-code/git-scope/main/scripts/install.sh | sh ``` +### Scoop (Windows) +```powershell +scoop bucket add git-scope https://github.com/Bharath-code/git-scope +scoop install git-scope +``` + ### From Source (Windows) ```bash diff --git a/git-scope.json b/git-scope.json new file mode 100644 index 0000000..0130deb --- /dev/null +++ b/git-scope.json @@ -0,0 +1,30 @@ +{ + "version": "1.4.0", + "description": "A fast TUI dashboard to view the git status of all your repositories in one place.", + "homepage": "https://github.com/Bharath-code/git-scope", + "license": "MIT", + "architecture": { + "64bit": { + "url": "https://github.com/Bharath-code/git-scope/releases/download/v1.4.0/git-scope_1.4.0_windows_amd64.zip", + "hash": "" + }, + "arm64": { + "url": "https://github.com/Bharath-code/git-scope/releases/download/v1.4.0/git-scope_1.4.0_windows_arm64.zip", + "hash": "" + } + }, + "bin": "git-scope.exe", + "checkver": { + "github": "https://github.com/Bharath-code/git-scope" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://github.com/Bharath-code/git-scope/releases/download/v$version/git-scope_$version_windows_amd64.zip" + }, + "arm64": { + "url": "https://github.com/Bharath-code/git-scope/releases/download/v$version/git-scope_$version_windows_arm64.zip" + } + } + } +} diff --git a/git-scope_test.go b/git-scope_test.go new file mode 100644 index 0000000..fd07958 --- /dev/null +++ b/git-scope_test.go @@ -0,0 +1,41 @@ +package gitscope_test + +import ( + "encoding/json" + "os" + "testing" +) + +func TestScoopManifestIsValidJSON(t *testing.T) { + data, err := os.ReadFile("git-scope.json") + if err != nil { + t.Fatalf("failed to read git-scope.json: %v", err) + } + + var manifest map[string]interface{} + if err := json.Unmarshal(data, &manifest); err != nil { + t.Fatalf("git-scope.json is not valid JSON: %v", err) + } + + requiredFields := []string{"version", "description", "homepage", "license", "architecture", "bin", "checkver", "autoupdate"} + for _, field := range requiredFields { + if _, ok := manifest[field]; !ok { + t.Errorf("missing required field: %s", field) + } + } + + arch, ok := manifest["architecture"].(map[string]interface{}) + if !ok { + t.Fatal("architecture field is not an object") + } + for _, key := range []string{"64bit", "arm64"} { + entry, ok := arch[key].(map[string]interface{}) + if !ok { + t.Errorf("architecture.%s is not an object", key) + continue + } + if _, ok := entry["url"]; !ok { + t.Errorf("architecture.%s missing url", key) + } + } +}