Skip to content

Subcommand add and sub #160

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

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d2b337b
Updated toml and toml_edit and fixed incompats
u-train Jun 16, 2023
3bb3e3b
Added packagesourcemap.search_for
u-train Jun 16, 2023
a450c12
Pulled PackageSpec into a util file
u-train Jun 16, 2023
3fcbc3b
Bump Semver (this commit is the source of all evil)
u-train Jun 17, 2023
e4d7fd2
Moved fromstr and display to manifest.rs
u-train Jun 17, 2023
67c541f
Initial Implementation of add.
u-train Jun 17, 2023
764ce24
what-realm -> realm arg
u-train Jun 18, 2023
9054c12
Fixed bug, supposed to be when there is no prerelease
u-train Jun 18, 2023
9751934
PackageReq serialization changed
u-train Jun 18, 2023
b66c457
It's just better aesthetically.
u-train Jun 18, 2023
85b921c
Now it will check the last pair of keys.
u-train Jun 26, 2023
c6a3edc
patched, suppose to not be negated
u-train Jun 26, 2023
5ca0f9d
trimed redundant .to_owned
u-train Jun 26, 2023
8059424
Undid the useless function, it was better inlined.
u-train Jun 26, 2023
62e1665
Finished, pulled carot function and did imports.
u-train Jun 26, 2023
bad014c
Completed testing and fixed bug.
u-train Jun 26, 2023
f4939a2
Simpler implementation for is_table_lexicographically_sorted
u-train Jun 28, 2023
bac3bd4
I realized my failings wrt impl, it isn't truly private.
u-train Jun 28, 2023
7d895d9
Clippy rituals
u-train Jun 28, 2023
56bcbc4
Add remove subcommand :D
u-train Jun 28, 2023
fadfdfa
PackageParam for Add has been done.
u-train Jun 30, 2023
7cfdcba
format
u-train Jun 30, 2023
c577e86
Added logging for add
u-train Jun 30, 2023
91f8f47
Added new testing utils
u-train Jul 1, 2023
09f1d9b
Went gung-ho in finishing remove
u-train Jul 1, 2023
b9e8978
Added testing for remove
u-train Jul 1, 2023
0144c35
clippy
u-train Jul 1, 2023
7939129
Obscurely cool bug: must save with original document.
u-train Jul 2, 2023
41aab54
Snapshots completed
u-train Jul 2, 2023
e72d434
Fixed test due to minimal being server realm and ran install after
u-train Jul 2, 2023
71f3150
fixed testing
u-train Jul 2, 2023
fda318c
Fixed test for targetting one realm to remove from.
u-train Jul 2, 2023
c28b49e
prune unused tests
u-train Jul 2, 2023
7e01ad5
let's use macros to make cleaner names for the snapshots
u-train Jul 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 11 additions & 99 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ once_cell = "1.5.2"
opener = "0.5.0"
reqwest = { version = "0.11.18", features = ["blocking", "json"] }
rpassword = "5.0.1"
semver = { version = "0.11.0", features = ["serde"] }
semver = { version = "1.0.17", features = ["serde"] }
serde = { version = "1.0.116", features = ["derive"] }
serde_json = "1.0.58"
structopt = "0.3.18"
tempfile = "3.1.0"
toml = "0.5.6"
toml_edit = "0.2.0"
toml = "0.7.4"
toml_edit = "0.19.10"
url = { version = "2.1.1", features = ["serde"] }
walkdir = "2.3.1"
whoami = "1.1.2"
Expand Down
11 changes: 9 additions & 2 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ impl AuthStore {

let mut auth: Document = contents.parse().unwrap();

if !auth.as_table_mut().contains_table("tokens") {
if !auth.as_table().contains_table("tokens") {
auth["tokens"] = table();
}

let tokens = auth.as_table_mut().entry("tokens");
let tokens = auth
.as_table_mut()
// We know that it exists due to the prior check.
.get_mut("tokens")
.unwrap()
// We know for a fact that it is a table due to the prior check.
.as_table_mut()
.unwrap();

if let Some(token) = token {
tokens[key] = value(token);
Expand Down
Loading