solidarity
solidarity copied to clipboard
Easily add a new rules with snapshot
CLI with no version
$ solidarity snapshot cli detox
Would you like to add the binary `detox` to your Solidarity file? (Y/n) True
Update complete
CLI with a version
$ solidarity snapshot cli node
Would you like to add the binary `node` to your Solidarity file? (Y/n) True
Would you like to enforce a version requirement? (Y/n) True
Your system currently has version 8.6.0
Semver requirement for `node` binary : ^8.6.0
Update complete
ENV var
$ solidarity snapshot env PATH
Would you like to add the environment requirement `PATH` to you Solidarity file? (Y/n) True
Update complete
File/Dir also.
$ solidarity snapshot file ./nachos
Would you like to add the file requirement `./nachos` to you Solidarity file? (Y/n) True
Update complete
@GantMan, I'm going to pick this up if nobody has started on this yet. I will put a PR early once I have a working implementation.
Sounds good. Should someone just say solidarity snapshot cli
and then it asks them questions regarding the CLI rule? Or do you like the specifics I have above?
Thinking "what's the optimal user experience" and then coding to that standard.
I'm okay with the original spec for the enhancement. Its one less step for the user.
That being said I think there is a potentially one missing step regarding a prompt for Making the new requirement or adding to an existing one.
So in the case of cli rule it would go as follows:
$ solidarity snapshot cli node
Would you like to add the binary `node` to your Solidarity file? (Y/n) True
Would you like to enforce a version requirement? (Y/n) True
Your system currently has version 8.6.0
Semver requirement for `node` binary : ^8.6.0
Would you like to add your new rule to an existing requirement or create a new one?(Y/n) True
What whould you like to name your new requirement? Node
Update complete
If the user chooses to add to an existing requirement then we list the existing requirements.
looks great
The PR w/ this functionality has been merged into master. I'm going to start another PR for the documentation.