Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Add support for custom ssb path#829

Merged
mmckegg merged 2 commits into
ssbc:masterfrom
stripedpajamas:custom-path
Jul 11, 2018
Merged

Add support for custom ssb path#829
mmckegg merged 2 commits into
ssbc:masterfrom
stripedpajamas:custom-path

Conversation

@stripedpajamas

Copy link
Copy Markdown
Contributor

This should allow stuff like running from a USB stick (#822). I added commander as a dependency so other command line options could be added later if the need arises.

With this PR, someone could set their shortcut to something like patchwork --path /custom/path or even patchwork --path . to use the cwd, which should be perfect for portable installs.

Since git-ssb doesn't take in configs, I have Patchwork skip starting it up if a custom path was passed in. If git-ssb changes to allow more granular configs, we can take that conditional out.

@mmckegg

mmckegg commented Jul 10, 2018

Copy link
Copy Markdown
Contributor

@stripedpajamas

This looks pretty good, and I'm tempted to accept as is. The only issue I have is that ssb-config actually has it's own command line parser (minimist via rc which is clever, but I'm not a huge fan of) that that takes the args passed to patchwork and turns them into config automatically.

So passing --path SOMETHING to patchwork would actually already set config.path: "SOMETHING". You can also do things like --friends.hops 10 which would set config.friends.hops.

It might be worth having a play around with the built in arg parser and see if you can get it do what you want. If not, I'll merge this!

@stripedpajamas

Copy link
Copy Markdown
Contributor Author

Nice catch!! It works perfectly. I updated my PR to just not start git-ssb if a custom path was passed in, so it doesn't blow up.

@mmckegg mmckegg merged commit bd6ae13 into ssbc:master Jul 11, 2018
@stripedpajamas stripedpajamas deleted the custom-path branch July 11, 2018 10:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants