-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Is it possible to support some kind(s) portable mode? #297
Comments
I think that the most clean way to check if Currently, this is the behaviour only if the artifact is compiled in debug mode, as I use preprocess macros. This could be the occation to delete this debug / release dispatch and just use db.cotp if found. Finally, we could fallback to default folder if the existing Let me know what you think about, thank you! |
Hello, replydev! Your way to deal the portable mode is more concise! Here is my understanding of the new behavior, correct me if I was wrong: The (new) App will first check it's working directory, if there is a db file, then load it. If the db does not exist or has some kind of error in it, load another db in the old place the App used to. (eg: %userprofile% folder on Windows, the ~ folder on Linux). If the App works like this, it will be great! Many many thanks for the amazing work!! Have a great day!!! |
Here is another detail need to be taken into consideration if the App works as described above. What if both DB corrupted(the one in the working directory and another one in the user's home folder)? Will there be some kind of warnings and prompts to allow user to create a new db? If the App is about to create a new db, will it ask the user to clarify which DB to create? |
Right now it will just display an error message. I would not create confusing behaviour of overwriting or deleting the file accidentally. |
Yeah, that sounds good! |
@PM2p5 you can use the environment variable Just took a look to the code today after long holidays. |
Hello, replydev! I've tested the variable of COTP_DB_PATH on Windows, it's working well! Testing method: Set an user variable of COTP_DB_PATH on Windows, and tested following values: Succeed:
Failed with the message:
Now the only thing left here is to design the portable mode, allow it to work together with the |
Could you please elaborate:
|
Hi, replydev! The portable mode in my opinion could be like this: 1st, check the existence of the I've peeked the branch of portable mode from here https://github.com/replydev/cotp/tree/feat/portable_mode
This seems to be the same idea as I wrote in the 1st and 2nd steps. Tell me something about your idea! |
Ok, i see that it's more or less already implemented. I will push a PR. |
Is it possible to support a portable mode? I think it will be much concise and easy to use if it does!
I have concluded 3 possible options:
By specify the location of the the core db file ".cotp\db.cotp", to a user specified place. The command switch would be:
cotp db --path 'path/to/the/db.cotp'.
Add a portable switch, and load the db in the same folder:
cotp --portable
Check if a blank file named 'portable_mode' exists, if yes, load the db in the same folder.
Thanks in advance!
The text was updated successfully, but these errors were encountered: