trackwriter, progress with tester client
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user