Rename loom → norn
The project is now norn: .loom/ is .norn/, loomctl is nornctl (NORNCTL_* env vars, ~/.config/nornctl), and the Gitea org is norn. Event logs moved with the directory but their text is unchanged — they are a record of what was decided at the time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6354c95fa
commit
dde7183528
36 files changed
+216
-216
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Package config reads the per-host settings loomctl needs to talk to a git host.
|
||||
// Package config reads the per-host settings nornctl needs to talk to a git host.
|
||||
//
|
||||
// The config is not only a secret. It is how you talk to a host at all — which
|
||||
// is why it is a set of named contexts with one current, and why a host's URL
|
||||
@@ -24,7 +24,7 @@ type Context struct {
|
||||
Host string `json:"host"`
|
||||
// Flavor selects the URL shapes: gitea, github or gitlab. Empty means gitea.
|
||||
Flavor string `json:"flavor,omitempty"`
|
||||
// Token is read-only. loomctl never writes over the network, so a token it
|
||||
// Token is read-only. nornctl never writes over the network, so a token it
|
||||
// is given should not carry write scope.
|
||||
Token string `json:"token,omitempty"`
|
||||
}
|
||||
@@ -36,17 +36,17 @@ type Config struct {
|
||||
|
||||
// Path is where the config lives. Never inside a repository.
|
||||
func Path() string {
|
||||
if p := os.Getenv("LOOMCTL_CONFIG"); p != "" {
|
||||
if p := os.Getenv("NORNCTL_CONFIG"); p != "" {
|
||||
return p
|
||||
}
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return filepath.Join(home, ".config", "loomctl", "config.json")
|
||||
return filepath.Join(home, ".config", "nornctl", "config.json")
|
||||
}
|
||||
|
||||
// Load reads the config. A missing file is not an error: everything loomctl
|
||||
// Load reads the config. A missing file is not an error: everything nornctl
|
||||
// does against a public repository works with no credential and no context.
|
||||
func Load() (*Config, error) {
|
||||
c := &Config{Contexts: map[string]Context{}}
|
||||
@@ -90,10 +90,10 @@ func (c *Config) Current() (Context, error) {
|
||||
// An environment variable wins over the file, so a token can be supplied for
|
||||
// one invocation without ever being written to disk.
|
||||
func (c *Config) TokenFor(host string) string {
|
||||
if t := os.Getenv("LOOMCTL_TOKEN_" + envKey(host)); t != "" {
|
||||
if t := os.Getenv("NORNCTL_TOKEN_" + envKey(host)); t != "" {
|
||||
return t
|
||||
}
|
||||
if t := os.Getenv("LOOMCTL_TOKEN"); t != "" {
|
||||
if t := os.Getenv("NORNCTL_TOKEN"); t != "" {
|
||||
return t
|
||||
}
|
||||
for _, ctx := range c.Contexts {
|
||||
|
||||
Reference in new issue
Block a user