No support for tilde expansion in paths
Problem description
In a number of places, Panto does not support tilde expansion. It can lead to frustrating or even unexpected and confusing behavior.
Expected behaviour
Panto should expand ~
in paths to the user's home directory.
Environment / reproduction
Giving a configuration file path with ~
yields a mildly frustrating error:
$ bin/panto --conf=~/.panto/panto.yaml --verbose=3
2018/07/16 11:14:02 could not load config file: open ~/.panto/panto.yaml: no such file or directory
Giving a path to panto-ctl init
with ~
yields unexpected behavior:
$ bin/panto-ctl init
Welcome to Panto!
panto-ctl will now ask you a few questions to set up your initial Panto environment.
Enter Panto data path: [/var/lib/panto] ~/.panto
Enter panto configuration file location: [/etc/panto/panto.yaml] ~/.panto/panto.yaml
...
Panto successfully configured!
To start Panto server run
bin/panto --conf=/Users/chrales/Work/go-workspace/src/gitlab.com/pantomath-io/panto/~/.panto/panto.yaml
Bonus points
I almost fixed this by typing rm -rf ~
.