File: win.go

package info (click to toggle)
golang-github-juju-utils 0.0~git20171220.f38c0b0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,748 kB
  • sloc: makefile: 20
file content (62 lines) | stat: -rw-r--r-- 1,493 bytes parent folder | download | duplicates (2)
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
61
62
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, 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")
}

// Touch implements Renderer.
func (w windowsRenderer) Touch(path string, timestamp *time.Time) []string {
	// TODO(ericsnow) Use ???
	panic("not supported")
}

// RedirectFD implements OutputRenderer.
func (w windowsRenderer) RedirectFD(dst, src string) []string {
	// TODO(ericsnow) Use ???
	panic("not supported")
}

// RedirectOutput implements OutputRenderer.
func (w windowsRenderer) RedirectOutput(filename string) []string {
	// TODO(ericsnow) Use ???
	panic("not supported")
}

// RedirectOutputReset implements OutputRenderer.
func (w windowsRenderer) RedirectOutputReset(filename string) []string {
	// TODO(ericsnow) Use ???
	panic("not supported")
}