Closed billiegoose closed 6 years ago
nice work @wmhilton. do you think this feels well-suited to be its own separate module / cli? it seems like it goes beyond basic hypergit functionality. we could link to it in the readme.
I think it would have been very hard to do as a separate CLI... right up until @staltz's commit f030a52e955d0bdb6b504f7f36a3addb70be9c87 adding an index.js
and an API to programatically call seed()
. That changes things... I might be able to now. I'll try that.
Oh, and it would help if you published that to npm. Seems like the last npm publish was 20 days ago and the index.js
was added 16 days ago. Edit: I'll make an issue for that, since I'm about to close this PR and all of this conversation will fade into obscurity.
FOUND BUG! DO NOT MERGE!
It was saving the log file into envpaths.config, which conflicts with the usage of readdir
which assumes that every output will be a folder whose name is a valid sodium key.
Race condition because it deletes the log file each time it starts, so there's a chance that seed
calls readdir before it writes to the log and so everything runs fine, but there's also a chance the new log file gets created before readdir
runs and then it crashes.
Please kindly redirect your attention to WIP https://github.com/wmhilton/hypergit-service 😁
npm is awesome. It was like barely any code.
hypergit service install
- will elevate privileges using sudo-prompt and create a service using os-servicehypergit service remove
- will undo whathypergit service install
didhypergit service seed
- is what the OS service calls. Basically a thin wrapper around regularhypergit seed
that redirects stdout to a log file and enables the OS to gracefully stop it.hypergit service logdir
- will print out the envpaths.config because I can never remember where the log is saved.The last trick is to go into the Window Services settings and modify the
hypergit
service to run as the current user rather than the Local System, so thatenvpaths
will be for your local user account rather than root. I didn't see a way to do that programmatically without knowing the current user's password, so I've left that for possible future work. I imagine something similar must be done for Mac/Linux users.Let's discuss! Is this good enough to merge? Is it an abomination that should be shunned? Does it work on anyone else's computer? Am I seeding all the repos correctly?