Add instructions for installing utility with windows powershell. Also fixed log file creation bug for windows clients.
diff --git a/README.md b/README.md
index 97ec491..6bf65ea 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
For a comprehensive explanation of the GOPATH env variable please see
[this document](https://golang.org/dl/) by the Go team.
-### Installing the utility
+### Installing the utility with Linux
First, build your Go directory structure. A comprehensive guide on the intended
structure of Go code can be [found here.](https://golang.org/doc/code.html)
@@ -42,11 +42,42 @@
go get -d ./...
go install $HOME/go/src/github.com/maps-booking/testclient/main.go
+### Installing the utility with Windows Powershell
+
+First, build your Go directory structure. A comprehensive guide on the intended
+structure of Go code can be [found here.](https://golang.org/doc/code.html)
+
+ $env:HOME = $env:USERPROFILE
+ md $env:HOME\go\bin
+ md $env:HOME\go\pkg
+ md $env:HOME\go\src\github.com\maps-booking
+
+Next, set the appropriate environment variables
+
+ $env:PATH = $env:PATH + ";" + (go env GOPATH) + "\bin"
+ $env:GOPATH = (go env GOPATH)
+ $env:GOBIN = (go env GOPATH) + "\bin"
+
+Next, retrieve the utility from the
+[maps-booking repository](https://maps-booking.googlesource.com/)
+
+ git clone https://maps-booking.googlesource.com/test_client $env:HOME\go\src\github.com\maps-booking\
+
+Lastly, download all dependencies and install the tool.
+
+ cd $env:HOME\go
+ go get -d .\...
+ go install $env:HOME\go\src\github.com\maps-booking\testclient\main.go
+
### Using the utility
After following the install steps above an executable should now live in
$HOME/go/bin/main
+
+or
+
+ $env:HOME\go\bin\main.exe
All available flags can be displayed using the '--help' flag. The currently
accepted flags are:
diff --git a/testclient/main.go b/testclient/main.go
index c3f5537..0a3eb5e 100644
--- a/testclient/main.go
+++ b/testclient/main.go
@@ -45,7 +45,7 @@
listFlow = flag.Bool("list_bookings_test", false, "Whether to test the ListBookings endpoint")
statusFlow = flag.Bool("booking_status_test", false, "Whether to test the GetBookingStatus endpoint.")
rescheduleFlow = flag.Bool("rescheduling_test", false, "Whether to test the UpdateBooking endpoint.")
- availabilityFeed = flag.String("availability_feed", "", "Absolute path to availablity feed required for all tests except health. Feeds can be in either json or pb3 format")
+ availabilityFeed = flag.String("availability_feed", "", "Absolute path to availability feed required for all tests except health. Feeds can be in either json or pb3 format")
outputDir = flag.String("output_dir", "", "Absolute path of dir to dump log file.")
)
@@ -101,7 +101,10 @@
return nil, err
}
}
- outFile := filepath.Join(outPath, fmt.Sprintf("%s%s", logFile, time.Now().UTC().Format(time.RFC3339)))
+
+ now := time.Now().UTC()
+ nowString := fmt.Sprintf("%d-%02d-%02d_%02d-%02d-%02d", now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
+ outFile := filepath.Join(outPath, fmt.Sprintf("%s%s", logFile, nowString))
return os.Create(outFile)
}