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

Unified Diff: deploytool/cmd/path.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/param.go ('k') | deploytool/cmd/staging.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: deploytool/cmd/path.go
diff --git a/deploytool/cmd/path.go b/deploytool/cmd/path.go
deleted file mode 100644
index 5f697f5cc5ac185a8577915fd6c18216f5013bbf..0000000000000000000000000000000000000000
--- a/deploytool/cmd/path.go
+++ /dev/null
@@ -1,66 +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 (
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
-
- "github.com/luci/luci-go/common/errors"
-)
-
-const (
- // configExt is the configuration file extension.
- configExt = ".cfg"
-)
-
-func splitSourceRelativePath(path string) []string {
- return strings.Split(path, "/")
-}
-
-// deployToNative converts the depoy tool path, path, to a native path.
-//
-// base is a native base path to prepend to the generated path. If empty, the
-// returned path will be relative.
-func deployToNative(base, path string) string {
- parts := splitSourceRelativePath(path)
- path = filepath.Join(parts...)
- if base != "" {
- path = filepath.Join(base, path)
- }
- return path
-}
-
-// deployDirname returns the directory name of the source-relative path.
-func deployDirname(path string) string {
- if idx := strings.LastIndex(path, "/"); idx >= 0 {
- return path[:idx]
- }
- return ""
-}
-
-func isHidden(path string) bool {
- return strings.HasPrefix(filepath.Base(path), ".")
-}
-
-func fileURLToPath(path string) string {
- if filepath.Separator == '/' {
- return path
- }
- return strings.Replace(path, "/", string(filepath.Separator), -1)
-}
-
-func withTempDir(f func(string) error) error {
- // Create a temporary directory.
- tdir, err := ioutil.TempDir("", "luci_deploytool")
- if err != nil {
- return errors.Annotate(err).Reason("failed to create tempdir").Err()
- }
- defer os.RemoveAll(tdir)
-
- return f(tdir)
-}
« no previous file with comments | « deploytool/cmd/param.go ('k') | deploytool/cmd/staging.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698