| Index: cipd/client/cipd/install_client.go
|
| diff --git a/cipd/client/cipd/install_client.go b/cipd/client/cipd/install_client.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..947ecd14894f9009f740aaf0e50c507805c7595b
|
| --- /dev/null
|
| +++ b/cipd/client/cipd/install_client.go
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2015 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.
|
| +
|
| +// +build !windows
|
| +
|
| +package cipd
|
| +
|
| +import (
|
| + "os"
|
| +
|
| + "github.com/luci/luci-go/cipd/client/cipd/local"
|
| + "golang.org/x/net/context"
|
| +)
|
| +
|
| +func (client *clientImpl) installClient(ctx context.Context, fs local.FileSystem, fetchURL, destination string) error {
|
| + curStat, err := os.Stat(destination)
|
| + if err != nil {
|
| + return err
|
| + }
|
| +
|
| + return fs.EnsureFile(ctx, destination, func(of *os.File) error {
|
| + if err := of.Chmod(curStat.Mode()); err != nil {
|
| + return err
|
| + }
|
| + // TODO(iannucci): worry about owner/group?
|
| + return client.storage.download(ctx, fetchURL, of)
|
| + })
|
| +}
|
|
|