hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Application assumes presence of "zones" directory

Open jonrichards opened this issue 5 years ago • 2 comments

If you don't have a zones directory present from where you invoke hermes (note: this is not necessarily the same path as where the hermes binary itself lives on the system), the application fails with the error Server failed to initialize: Authority(Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })). I see a few options for improving this:

  1. Update the README.md with instructions covering this, and leave it to the user to setup the zones directory before running hermes.

  2. Create the zones directory if not present when hermes is invoked (e.g. fs::create_dir_all("zones")?;):

    1. At the location that hermes was invoked from.

    2. At a predefined location in the $HOME directory of the user (e.g. $home/.hermes/zones).

  3. Add a command line argument for specifying the path of the zones directory when invoking hermes and:

    1. Make this a required argument.

    2. Make this optional, and when not present and no zones directory is found, create it per 2 above.

At a minimum I think doing 1 would be an improvement, and I'd be happy to quickly write that up and submit.

If there's interest in another option, either from this list or some other solution, let me know and I could put something together for review.

jonrichards avatar Jul 26 '20 17:07 jonrichards

Hi Jon!

That’s a good point of feedback and something I’ve heard from other users too. Suggestion 2.1 i.e auto-creating the dir in the folder that it was invoked from would be my preferred solution. It’d be great if you wanted to contribute a solution here.

EmilHernvall avatar Jul 26 '20 17:07 EmilHernvall

Great, I'll submit a pull request soon for that.

jonrichards avatar Jul 26 '20 21:07 jonrichards