Comments (2)
You're able to specify the maFiles folder that contains the manifest and .maFile files. =)
-m, --mafiles-path <MAFILES_PATH>
Specify which folder your maFiles are in. This should be a path to a folder that
contains manifest.json. Default: ~/.config/steamguard-cli/maFiles
[env: STEAMGUARD_CLI_MAFILES=]
But I also think that it would be nice to automatically select the maFiles folder if one exists in the current working/app directory.
from steamguard-cli.
If I had to nitpick on #277: The maFiles next to the exe should be prioritized over config_dir & home_dir... but if neither of them exist.
fn get_mafiles_dir() -> String {
let mut paths = vec![
Path::new(&dirs::config_dir().unwrap()).join("steamguard-cli/maFiles"),
Path::new(&dirs::home_dir().unwrap()).join("maFiles"),
];
if let Ok(current_exe) = std::env::current_exe() {
paths.insert(0, current_exe.parent().unwrap().join("maFiles")); // insert at the index 0 for priority
}
for path in &paths {
if path.join("manifest.json").is_file() {
return path.to_str().unwrap().into();
}
}
return paths[1].to_str().unwrap().into(); // index 1 so it doesn't default to adjacent dir for creation/setup
}
I'm not really familiar with Rust but this seems to do it for me - minimal changes. =)
EDIT: Ah, I didn't consider a failing if let Ok(current_exe) = std::env::current_exe() ...
. That would mess up the "positioning". I guess a few more lines are needed.
EDIT2: Maybe something like this?
fn get_mafiles_dir() -> String {
let default_path = Path::new(&dirs::config_dir().unwrap()).join("steamguard-cli/maFiles");
let mut paths = vec![
default_path.clone(),
Path::new(&dirs::home_dir().unwrap()).join("maFiles"),
];
if let Ok(current_exe) = std::env::current_exe() {
paths.insert(0, current_exe.parent().unwrap().join("maFiles"));
}
for path in &paths {
if path.join("manifest.json").is_file() {
return path.to_str().unwrap().into();
}
}
return default_path.to_str().unwrap().into();
}
from steamguard-cli.
Related Issues (20)
- Failed to migrate manifest HOT 3
- Cannot import mafile from SDA HOT 4
- Chinese phone numbers might not receive verification code if language variable is not set
- arch linux: use `-C target-cpu=native` in PKGBUILD HOT 2
- confirmation error HOT 2
- Automatically retry submitting confirmations
- Support for importing Winauth files HOT 3
- "Unexpected error when trying to log in." or "Failed to link authenticator. Account has not been linked. Invalid padding" HOT 2
- Can't add accounts just like SDA HOT 3
- binary aur package
- Importing Steamguard-* files from Android HOT 9
- Error accept confirmations HOT 2
- `.deb` in releases is not installable on debian 11 because of missing zstd support in dpkg HOT 7
- Steam no longer provides access token upon first login, so logging in fails HOT 5
- ERROR - Pipe closed. (os error 232) HOT 7
- Schema migration fails due to missing_field server_time HOT 5
- steamguard-cli trade show nothing HOT 4
- can't setup guard HOT 2
- Confirmation submit
- Thank You!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from steamguard-cli.