You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stackmuncher/src/config.rs
+27-73Lines changed: 27 additions & 73 deletions
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,12 @@ pub(crate) struct AppConfig {
26
26
pubcommand:AppArgCommands,
27
27
pubdryrun:bool,
28
28
pubprimary_email:Option<String>,
29
-
pubpublic_name:Option<String>,
30
-
pubpublic_contact:Option<String>,
29
+
/// A 32-byte long hex string of the Gist ID with the validation string for the user GH account
30
+
/// E.g. `fb8fc0f87ee78231f064131022c8154a`
31
+
pubgh_validation_id:Option<String>,
32
+
/// The URL is reconstructed from a Gist ID after validation.
33
+
/// It may seize to exist or change the contents, but the URL itself is guaranteed to be valid
34
+
pubgh_validation_url:Option<String>,
31
35
/// Core config from stackmuncher_lib
32
36
publib_config:Config,
33
37
/// Extracted from the key file stored next to the config file
@@ -40,8 +44,9 @@ pub(crate) struct AppConfig {
40
44
#[derive(Serialize,Deserialize,PartialEq)]
41
45
structAppConfigCache{
42
46
pubprimary_email:Option<String>,
43
-
pubpublic_name:Option<String>,
44
-
pubpublic_contact:Option<String>,
47
+
/// The URL is reconstructed from a Gist ID after validation.
48
+
/// It may seize to exist or change the contents, but the URL itself is guaranteed to be valid
49
+
pubgh_validation_url:Option<String>,
45
50
pubgit_identities:Vec<String>,
46
51
}
47
52
@@ -202,69 +207,6 @@ impl AppConfig {
202
207
None
203
208
};
204
209
205
-
let public_name = ifletSome(pub_name) = &app_args.public_name{
206
-
if pub_name.is_empty(){
207
-
// empty public name - make anon
208
-
println!("Your Directory Profile name was removed. Your profile will be anonymous.");
209
-
println!();
210
-
println!(
211
-
" Run `stackmuncher{} --public_name \"My Name or Nickname\"` to make it public.",
212
-
EXE_SUFFIX
213
-
);
214
-
println!();
215
-
}else{
216
-
// a new public name was supplied
217
-
println!(
218
-
"Your new Directory Profile name: {}. It is visible to anyone, including search engines.",
219
-
pub_name
220
-
);
221
-
println!();
222
-
println!(
223
-
" Run `stackmuncher{} --public_name \"\"` to remove the name and make your profile anonymous.",
224
-
EXE_SUFFIX
225
-
);
226
-
println!();
227
-
}
228
-
app_args.public_name
229
-
}elseif app_config_cache.public_name.is_some(){
230
-
app_config_cache.public_name.clone()
231
-
}else{
232
-
None
233
-
};
234
-
235
-
let public_contact = ifletSome(pub_contact) = &app_args.public_contact{
236
-
if pub_contact.is_empty(){
237
-
// no public contact details
238
-
if primary_email.is_some() && !primary_email.as_ref().unwrap().is_empty(){
239
-
println!("Your Directory Profile contact details were removed. Employers will be able to express their interest via Directory notifications sent to {}.", primary_email.as_ref().unwrap());
240
-
}else{
241
-
println!("Your Directory Profile contact details were removed. Since your primary email address is blank as well your profile will be hidden.");
242
-
}
243
-
244
-
println!();
245
-
println!(
246
-
" Run `stackmuncher{} --public_contact \"Your email, website or any other contact details\"` for employers to contact you directly.",
247
-
EXE_SUFFIX
248
-
);
249
-
println!();
250
-
}else{
251
-
// new public contact details
252
-
println!(
253
-
"Your new Directory Profile contact: {}. It is visible to anyone, including search engines.",
254
-
pub_contact
255
-
);
256
-
println!();
257
-
println!(" Run `stackmuncher{} --public_contact \"\"` to remove it.",EXE_SUFFIX);
0 commit comments