Skip to content

Commit 8411984

Browse files
committed
Added --gist instructions to Readme #20
1 parent aaa82ac commit 8411984

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cd stm_app
4747
cargo run -- --project "path_to_any_of_your_local_projects"
4848
```
4949

50-
The app will access `.git` folder inside `path_to_any_of_your_local_projects` directory and create an anonymous profile with your first report on _stackmuncher.com_. Add `--dryrun` flag to generate a report without creating a profile or submitting any data to the Directory. Look at the log printed by the app for details to examine the prepared report.
50+
The app will access `.git` folder inside `path_to_any_of_your_local_projects` directory and create an anonymous profile with your first report on _stackmuncher.com_. Add `--dryrun` flag to generate a report without creating a profile or submitting any data to the Directory. Look at the log printed by the app for details if you want to examine the prepared report.
5151

5252
The **default config** of the app assumes that it is run on a development machine from the root folder of a repository you made commits to.
5353

@@ -83,7 +83,7 @@ Find out what email addresses were used in commits to `xml_to_serde` repo:
8383
_mx_ and _rimutaka_ are the same person. Let's add both emails to StackMuncher config using `--email` parameter:
8484

8585
```shell
86-
~/rust/stm_app$ cargo run -- view_config --emails "[email protected], [email protected]"
86+
~/rust/stm_app$ cargo run -- config --emails "[email protected], [email protected]"
8787

8888
Primary email: [email protected]
8989
@@ -96,8 +96,7 @@ _mx_ and _rimutaka_ are the same person. Let's add both emails to StackMuncher c
9696
Code analysis rules: /home/ubuntu/rust/stm_app/stm_rules
9797
Config file: /home/ubuntu/rust/stm_app/.stm_config/config.json
9898
```
99-
The app stored two emails from `--emails` param in its config file and printed its full config info (`view_config` command). From now on it will look for commits from _[email protected]_ and _[email protected]_.
100-
99+
The app stored two emails from `--emails` param in its config file and printed its full config info (`config` command). From now on it will look for commits from _[email protected]_ and _[email protected]_.
101100

102101
## Adding more projects to your profile
103102

@@ -122,10 +121,20 @@ Git will invoke the app every time you make a commit to a repo with the post-com
122121

123122
You can skip adding the Git hook and run `stackmuncher` from the root of any of your projects. No additional params are required.
124123

124+
## Making your profile public
125+
126+
Public profiles are searchable by employers looking for software developers. Your public profile will be created with the same login and personal details as your GitHub profile.
127+
128+
E.g. https://stackmuncher.com/rimutaka has _contact details_ and _public projects_ from https://github.com/rimutaka as well as _private projects_ from https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK.
129+
130+
1. Run `stackmuncher github`
131+
2. Use the signature it printed for a private Gist to confirm your GitHub account ownership
132+
3. Run `stackmuncher config --gist [URL of the Gist]`
133+
125134
## Using StackMuncher app on multiple machines
126135

127136
1. Clone this repo onto a 2nd machine
128-
2. Run `cargo run -- view_config` to bootstrap the app
137+
2. Run `cargo run -- config` to bootstrap the app
129138
3. Copy-paste the contents of `.stm_config/config.json` and `.stm_config/key.txt` from the 1st to the 2nd machine
130139

131140
The 2nd machine will be connected to the same Developer Profile as the first one for as long as they share the same _key.txt_ file. If you loose the key file the app will generate a new one and create a new Developer Profile. Contact us on [email protected] to merge the old profile into the new one.
@@ -135,7 +144,7 @@ The 2nd machine will be connected to the same Developer Profile as the first one
135144
Running `stackmuncher` without any additional params generates a report for the project in the current working directory and updates your developer profile.
136145

137146
Anonymous profiles are identified by a public key from the key-pair generated by the app on the first run. E.g. https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK
138-
The key is located in the app's config folder and can be copied to another machine to connect to the same developer profile. Run `stackmuncher view_config` command to see the exact location of the config folder.
147+
The key is located in the app's config folder and can be copied to another machine to connect to the same developer profile. Run `stackmuncher config` command to see the exact location of the config folder.
139148
140149
### Additional options
141150
@@ -163,7 +172,7 @@ Example:
163172

164173
Example:
165174
```shell
166-
~$ stackmuncher view_config --primary_email "[email protected]" --public_name "rimutaka" --public_contact "[email protected] or https://rimutaka.me"
175+
~$ stackmuncher config --primary_email "[email protected]" --public_name "rimutaka" --public_contact "[email protected] or https://rimutaka.me"
167176
168177
Primary email: [email protected]
169178
@@ -184,10 +193,10 @@ Example:
184193
* `--reports "path to reports folder"`: a path to an alternative location for saving stack reports. The path can be relative or absolute. Defaults to the application folder.
185194
* `--config "path to config folder"`: a path to an alternative location of the config folder. The path can be relative or absolute. Defaults to the application folder.
186195

187-
* `--help`: display usage info
196+
#### Additional info
188197

189-
#### Additional commands
190-
* `view_config`: displays the contents of the config file and its location. The config file can be edited manually or copied to another machine together with the key file to connect to the same Developer Profile.
198+
* `stackmuncher help`: displays usage info
199+
* `stackmuncher config`: display the contents of the config file and its location. The config file can be edited manually.
191200

192201
## Limitations
193202

@@ -213,7 +222,7 @@ We want to hear about as many issues users run into as possible. Copy-paste the
213222
**If the app did something, but no report was submitted:**
214223

215224
* look through the log it printed for clues
216-
* run `stackmuncher view_config` and check the output in `reports` folder - there should be at least 4 files:
225+
* run `stackmuncher config` and check the output in `reports` folder - there should be at least 4 files:
217226
* _project_report.json_: includes all contributors
218227
* _combined_report.json_: a combined report for authors/committers from Git's `user.email` setting and from `--emails` param
219228
* _submitted_report.json_: a sanitized version of the combined report exactly as it was submitted to the Directory

stackmuncher/src/app_args.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl FromStr for AppArgCommands {
4949
let command = match command.as_str() {
5050
"help" => Self::Help,
5151
"" | "munch" => Self::Munch,
52-
"viewconfig" | "view-config" | "view_config" | "config" => Self::ViewConfig,
52+
"config" => Self::ViewConfig,
5353
"makeanon" | "make-anon" | "make_anon" => Self::MakeAnon,
5454
"deleteprofile" | "delete-profile" | "delete_profile" | "delete" => Self::DeleteProfile,
5555
"github" => Self::GitGHubConfig,
@@ -101,8 +101,6 @@ impl AppArgs {
101101
// help has a higher priority and should be handled separately
102102
if pargs.contains(["-h", "--help"]) {
103103
app_args.command = AppArgCommands::Help;
104-
} else if pargs.contains("--view_config") || pargs.contains("--viewconfig") {
105-
app_args.command = AppArgCommands::ViewConfig;
106104
}
107105

108106
// --noupdate param with different misspellings

stackmuncher/src/configure.rs renamed to stackmuncher/src/cmd_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(crate) async fn github(config: AppConfig) {
5050
help::emit_gist_instructions(&expected_gist_content);
5151
}
5252

53-
/// A temporary stub for `view_config` command.
53+
/// Prints its full current configuration, file locations, profile URL and some usage info.
5454
pub(crate) async fn view_config(config: AppConfig) {
5555
// prepare values needed in println!() macros to prevent line wrapping in the code
5656
let pub_key = ReportSignature::get_public_key(&config.user_key_pair);

stackmuncher/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl AppConfig {
240240
// Otherwise use what is in the cache without any validation.
241241
let gh_validation_url = if app_args.gh_validation_id.is_some() {
242242
// --gist was present - so something was requested
243-
match crate::configure::get_validated_gist(&app_args.gh_validation_id, &user_key_pair).await {
243+
match crate::cmd_config::get_validated_gist(&app_args.gh_validation_id, &user_key_pair).await {
244244
Some(gist) => Some(gist.html_url),
245245
None => None,
246246
}

stackmuncher/src/help.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ pub(crate) fn emit_key_err_msg(key_file_path: &str) {
9494
" 2. If you didn't edit {} you can delete it and the app will generate a new one.",
9595
key_file_path
9696
);
97-
eprintln!(" The side effect of that is that the app will also create a new Developer Profile for you.");
98-
eprintln!(" If you think you lost your original key, just delete the file and contact us on [email protected] to link your existing Developer Profile to the new key.");
97+
eprintln!(" The side effect of that is that the app will also create a new Directory Profile for you.");
98+
eprintln!(" If you think you lost your original key, just delete the file and contact us on [email protected] to link your existing Directory Profile to the new key.");
9999
eprintln!(" We apologize for not automating this step yet.");
100100
eprintln!();
101101
}
@@ -201,7 +201,7 @@ OPTIONS:
201201
202202
MORE INFO:
203203
204-
stackmuncher{exe_suffix} config prints URLs of your Developer Profile and other configuration details
204+
stackmuncher{exe_suffix} config prints URLs of your Directory Profile and other configuration details
205205
206206
https://stackmuncher.com/about about the Directory
207207
https://github.com/stackmuncher source code, issues and more

stackmuncher/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use path_absolutize::{self, Absolutize};
33
use tracing::info;
44

55
mod app_args;
6+
mod cmd_config;
67
mod cmd_munch;
78
mod config;
8-
mod configure;
99
mod help;
1010
mod signing;
1111
mod submission;
@@ -60,13 +60,13 @@ async fn main() -> Result<(), ()> {
6060
make_anon();
6161
}
6262
app_args::AppArgCommands::ViewConfig => {
63-
configure::view_config(config).await;
63+
cmd_config::view_config(config).await;
6464
}
6565
app_args::AppArgCommands::Help => {
6666
help::emit_welcome_msg(config);
6767
}
6868
app_args::AppArgCommands::GitGHubConfig => {
69-
configure::github(config).await;
69+
cmd_config::github(config).await;
7070
}
7171
};
7272

0 commit comments

Comments
 (0)