-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Migration of zuliprc location to a config directory #1503
base: main
Are you sure you want to change the base?
Commits on Aug 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 59828e4 - Browse repository at this point
Copy the full SHA 59828e4View commit details -
refactor: run: Split parse_zuliprc() to create a separate function.
Created resolve_to_valid_path() to return a valid zuliprc path. Added docstring.
Configuration menu - View commit details
-
Copy full SHA for 8d17aa9 - Browse repository at this point
Copy the full SHA 8d17aa9View commit details -
refactor: run: Set zuliprc_path via login_and_save().
Previously, zuliprc_path was set directly in main(). Now, we are setting it 2 levels deeper, inside of login_and_save(), passing it to main() through resolve_to_valid_path(). main() now sets the default value of zuliprc_path to None, and uses the returned path from resolve_to_valid_path(). This is done to allow adding support for multiple zuliprc paths later, where we will dynamically compute the path in login_and_save(), after taking user input.
Configuration menu - View commit details
-
Copy full SHA for ebd394f - Browse repository at this point
Copy the full SHA ebd394fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bde5fd - Browse repository at this point
Copy the full SHA 1bde5fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0a0726 - Browse repository at this point
Copy the full SHA c0a0726View commit details -
run: Use the new config directory as a default zuliprc path.
In addition to the previous default path ~/zuliprc. Introduce the .config path of zulip-terminal as a str constant. Add a function check_for_default_zuliprc() to search for zuliprc files in both the default locations, when the --config-file argument is not used. It is added to ensure that users who have only a single account can skip using the account alias argument that will be added. Docstring updated. Tests updated.
Configuration menu - View commit details
-
Copy full SHA for d866880 - Browse repository at this point
Copy the full SHA d866880View commit details -
run: Create account-wise zuliprc files in the new config path.
Newly generated zuliprc files were being saved to `~/zuliprc`. This moves default zuliprc creation into the user's config directory. The --config-file option will no longer be able to save zuliprc files in custom locations. The new config path including the .config directory are handled safely, to allow creation even if they do not already exist. Tests updated. The test with id: `path_does_not_exist`, in the test function `test_main_cannot_write_zuliprc_given_good_credentials()` has been removed, as the path will now be created even if it does not exist.
Configuration menu - View commit details
-
Copy full SHA for a4038b2 - Browse repository at this point
Copy the full SHA a4038b2View commit details
Commits on Aug 24, 2024
-
run: Add new positional argument
account-alias
to load config.The usage of the account-alias positional argument is made mutually exclusive with the config-file option.
Configuration menu - View commit details
-
Copy full SHA for ffdd5ee - Browse repository at this point
Copy the full SHA ffdd5eeView commit details -
run: Add new argument
--list-accounts
.Lists all the accounts in the config path, by checking the directory structure. The home path zuliprc is not considered in this list. Tests updated.
Configuration menu - View commit details
-
Copy full SHA for 330d6c9 - Browse repository at this point
Copy the full SHA 330d6c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27473c1 - Browse repository at this point
Copy the full SHA 27473c1View commit details -
refactor: run: Stop passing zuliprc_path to login_and_save().
Previously, we had to pass the zuliprc_path because the --config-file option could be used to create a zuliprc at a custom location. Now, all accounts are only saved to the standard config path. So, by moving the print statement to the outer function, we can simplify login_and_save().
Configuration menu - View commit details
-
Copy full SHA for 817b46a - Browse repository at this point
Copy the full SHA 817b46aView commit details -
run: Add new argument
--new--account
to create a new account.- If --new-account is used along with --config-file, - If the given path is valid, that zuliprc will be loaded - Else, a new account will be created, but not at the given path. - If --new-account is used along with account-alias, the new account argument will be ignored. Tests updated.
Configuration menu - View commit details
-
Copy full SHA for 9681331 - Browse repository at this point
Copy the full SHA 9681331View commit details