forked from juju/utils
/
win.go
60 lines (49 loc) · 1.32 KB
/
win.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package shell
import (
"os"
"strings"
"time"
"github.com/juju/utils/filepath"
)
// windowsRenderer is the base implementation for Windows shells.
type windowsRenderer struct {
filepath.WindowsRenderer
}
// ExeSuffix implements Renderer.
func (w *windowsRenderer) ExeSuffix() string {
return ".exe"
}
// ScriptPermissions implements ScriptWriter.
func (w *windowsRenderer) ScriptPermissions() os.FileMode {
return 0755
}
// Render implements ScriptWriter.
func (w *windowsRenderer) RenderScript(commands []string) []byte {
return []byte(strings.Join(commands, "\n"))
}
// Chown implements Renderer.
func (w windowsRenderer) Chown(path, owner, group string) []string {
// TODO(ericsnow) Use ???
panic("not supported")
return nil
}
// Touch implements Renderer.
func (w windowsRenderer) Touch(path string, timestamp *time.Time) []string {
// TODO(ericsnow) Use ???
panic("not supported")
return nil
}
// RedirectFD implements Renderer.
func (w windowsRenderer) RedirectFD(dst, src string) []string {
// TODO(ericsnow) Use ???
panic("not supported")
return nil
}
// RedirectOutput implements Renderer.
func (w windowsRenderer) RedirectOutput(filename string) []string {
// TODO(ericsnow) Use ???
panic("not supported")
return nil
}