mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-14 02:02:02 -04:00
allow to build on solaris
This commit is contained in:
@@ -118,8 +118,3 @@ var (
|
||||
wrappedStdout *os.File
|
||||
wrappedStderr *os.File
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Initialize the platform-specific code
|
||||
initPlatform()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package wrappedreadline
|
||||
|
||||
// getWidth impl for Solaris
|
||||
func getWidth() int {
|
||||
return 80
|
||||
}
|
||||
|
||||
// get width of the terminal
|
||||
func getWidthFd(stdoutFd int) int {
|
||||
return getWidth()
|
||||
}
|
||||
@@ -44,7 +44,7 @@ func getWidthFd(stdoutFd int) int {
|
||||
return int(ws.Col)
|
||||
}
|
||||
|
||||
func initPlatform() {
|
||||
func init() {
|
||||
// The standard streams are passed in via extra file descriptors.
|
||||
wrappedStdin = os.NewFile(uintptr(3), "stdin")
|
||||
wrappedStdout = os.NewFile(uintptr(4), "stdout")
|
||||
|
||||
@@ -13,7 +13,7 @@ func getWidth() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func initPlatform() {
|
||||
func init() {
|
||||
wrappedStdin = openConsole("CONIN$", os.Stdin)
|
||||
wrappedStdout = openConsole("CONOUT$", os.Stdout)
|
||||
wrappedStderr = wrappedStdout
|
||||
|
||||
Reference in New Issue
Block a user