this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

small updates

+18 -8
+2 -2
cmd/glot/publish.go
··· 23 23 var cmdPublish = &cli.Command{ 24 24 Name: "publish", 25 25 Usage: "upload any new or updated lexicons", 26 - Description: "Publishes any new or updated local lexicons to the network, by creating schema records under the authenticated account.\nPublication requires a working AT network account, and appropriate DNS configuration. By default will only publish lexicons with DNS configured for the current account. See 'check-dns' command for configuration help, and '--skip-dns-check' to override.\nChecks schema status against live network and will not re-publish identical schemas, or update schemas by default (use '--update' to skip this check).\nOperates on entire ./lexicons/ directory unless specific files or directories are provided.", 26 + Description: "Publishes any new or updated local lexicons to the network, by creating schema records under the authenticated account.\nPublication requires a working AT network account, and appropriate DNS configuration. By default will only publish lexicons with DNS configured for the current account. See 'check-dns' command for configuration help, and '--skip-dns-check' to override (note that this can clobber any existing records).\nChecks schema status against live network and will not re-publish identical schemas, or update schemas by default (use '--update' to skip this check).\nOperates on entire ./lexicons/ directory unless specific files or directories are provided.", 27 27 ArgsUsage: `<file-or-dir>*`, 28 28 Flags: []cli.Flag{ 29 29 &cli.StringFlag{ ··· 34 34 }, 35 35 &cli.StringFlag{ 36 36 Name: "username", 37 - Aliases: []string{"u"}, 38 37 Usage: "account identifier (handle or DID) for login", 39 38 Sources: cli.EnvVars("GLOT_USERNAME", "ATP_USERNAME"), 40 39 }, ··· 175 174 if remoteJSON != nil { 176 175 if !cmd.Bool("update") { 177 176 fmt.Printf(" 🟠 %s\n", nsid) 177 + continue 178 178 } 179 179 180 180 local, err := data.UnmarshalJSON(localJSON)
+8 -3
cmd/glot/pull.go
··· 7 7 "log/slog" 8 8 "os" 9 9 "path" 10 - "strings" 11 10 12 11 "github.com/bluesky-social/indigo/api/agnostic" 13 12 "github.com/bluesky-social/indigo/atproto/client" ··· 36 35 Aliases: []string{"u"}, 37 36 Usage: "overwrite any existing local files", 38 37 }, 39 - // TODO: output-dir (instead of auto) 38 + &cli.StringFlag{ 39 + Name: "output-dir", 40 + Aliases: []string{"o"}, 41 + Value: "./lexicons/", 42 + Usage: "write schema files to specific directory", 43 + Sources: cli.EnvVars("LEXICONS_DIR"), 44 + }, 40 45 }, 41 46 Action: runPull, 42 47 } ··· 156 161 slog.Warn("ignoring invalid schema NSID", "did", ident.DID, "rkey", aturi.RecordKey()) 157 162 continue 158 163 } 159 - if !strings.HasPrefix(nsid.String(), group) { 164 + if nsidGroup(nsid) != group { 160 165 // ignoring other NSIDs 161 166 continue 162 167 }
+2 -3
cmd/glot/status.go
··· 11 11 "path/filepath" 12 12 "reflect" 13 13 "sort" 14 - "strings" 15 14 16 15 "github.com/bluesky-social/indigo/api/agnostic" 17 16 "github.com/bluesky-social/indigo/atproto/client" ··· 193 192 did, err := dir.ResolveNSID(ctx, syntax.NSID(group+"name")) 194 193 if err != nil { 195 194 // if NSID isn't registered, just skip comparison 196 - slog.Warn("skipping NSID pattern which did not resolve", "group", group) 195 + slog.Debug("skipping NSID pattern which did not resolve", "group", group) 197 196 return nil 198 197 } 199 198 ident, err := dir.LookupDID(ctx, did) ··· 219 218 slog.Warn("ignoring invalid schema NSID", "did", ident.DID, "rkey", aturi.RecordKey()) 220 219 continue 221 220 } 222 - if !strings.HasPrefix(nsid.String(), group) { 221 + if nsidGroup(nsid) != group { 223 222 // ignoring other NSIDs 224 223 continue 225 224 }
+6
cmd/glot/util.go
··· 36 36 } 37 37 38 38 func pathForNSID(cmd *cli.Command, nsid syntax.NSID) string { 39 + 40 + odir := cmd.String("output-dir") 41 + if odir != "" { 42 + return path.Join(odir, nsid.Name()+".json") 43 + } 44 + 39 45 base := cmd.String("lexicons-dir") 40 46 sub := strings.ReplaceAll(nsid.String(), ".", "/") 41 47 return path.Join(base, sub+".json")