Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: deploytool/cmd/config.go

Issue 2182213002: deploytool: Add README.md, migrate docs to it. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Rename to "luci_deploy" Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « deploytool/cmd/checkout.go ('k') | deploytool/cmd/deploy.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: deploytool/cmd/config.go
diff --git a/deploytool/cmd/config.go b/deploytool/cmd/config.go
deleted file mode 100644
index 63f00becc63942d3774ace7eb0507f319d385f33..0000000000000000000000000000000000000000
--- a/deploytool/cmd/config.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2016 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
-package main
-
-import (
- "path/filepath"
-
- "github.com/luci/luci-go/common/errors"
- log "github.com/luci/luci-go/common/logging"
- "github.com/luci/luci-go/deploytool/api/deploy"
-
- "github.com/mitchellh/go-homedir"
- "golang.org/x/net/context"
-)
-
-const userCfgName = ".luci_deploytool"
-
-func loadUserConfig(c context.Context, cfg *deploy.UserConfig) error {
- path, err := homedir.Dir()
- if err != nil {
- log.WithError(err).Warningf(c, "Failed to get user home directory; cannot load local config.")
- return nil
- }
-
- configPath := filepath.Join(path, userCfgName)
- switch err := unmarshalTextProtobuf(configPath, cfg); {
- case err == nil:
- log.Infof(c, "Loaded user config from: %s", configPath)
-
- case isNotExist(err):
- log.Debugf(c, "No user config found at: %s", configPath)
-
- default:
- return errors.Annotate(err).Reason("failed to load config at [%(path)s]").D("path", configPath).Err()
- }
-
- return nil
-}
« no previous file with comments | « deploytool/cmd/checkout.go ('k') | deploytool/cmd/deploy.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698