trackwriter, progress with tester client

This commit is contained in:
David Zhao
2020-11-09 23:38:05 -08:00
parent cba27d164b
commit 408ea3fe22
9 changed files with 392 additions and 13 deletions
+12
View File
@@ -3,6 +3,9 @@ package commands
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/urfave/cli/v2"
)
@@ -26,3 +29,12 @@ func PrintJSON(obj interface{}) {
txt, _ := json.Marshal(obj)
fmt.Println(string(txt))
}
func ExpandUser(p string) string {
if strings.HasPrefix(p, "~") {
home, _ := os.UserHomeDir()
return filepath.Join(home, p[1:])
}
return p
}