Extra loggina and README updates

This commit is contained in:
Thomas Buckley-Houston 2018-06-23 17:16:12 +08:00
parent 802a61204d
commit 70d3f45f60
3 changed files with 6 additions and 6 deletions

View file

@ -38,10 +38,10 @@ a text-based web in your terminal.
## Installation
Download a binary from the [releases](https://github.com/tombh/texttop/releases) (~2MB).
Download a binary from the [releases](https://github.com/tombh/texttop/releases) (~2-6MB).
You will need to have Firefox >=57 aleady installed.
Or download and run the Docker image (~800MB) with:
Or download and run the Docker image (~230MB) with:
`docker run -it tombh/texttop`
## Usage

View file

@ -46,6 +46,7 @@ func setupLogging() {
Shutdown(err)
}
logfile = fmt.Sprintf(filepath.Join(dir, "debug.log"))
fmt.Println("Logging to: " + logfile)
if _, err := os.Stat(logfile); err == nil {
os.Truncate(logfile, 0)
}
@ -148,8 +149,8 @@ func Shell(command string) string {
parts = parts[1:len(parts)]
out, err := exec.Command(head, parts...).CombinedOutput()
if err != nil {
fmt.Printf(
"Browsh tried to run `%s` but failed with: %s", command, string(out))
Log(fmt.Sprintf(
"Browsh tried to run `%s` but failed with: %s", command, string(out)))
Shutdown(err)
}
return stripWhitespace(string(out))

View file

@ -242,8 +242,7 @@ func beginTimeLimit() {
message := fmt.Sprintf("Browsh will close in %d seconds...", warningLength)
sendMessageToWebExtension("/status," + message)
time.Sleep(time.Duration(warningLength) * time.Second)
quitFirefox()
Shutdown(errors.New("normal"))
quitBrowsh()
}
// Note that everything executed in and from this function is not covered by the integration