Skip to content

Commit

Permalink
Merge pull request #132 from tdejager/feat/fix-add
Browse files Browse the repository at this point in the history
fix: fix add command
  • Loading branch information
ruben-arts authored Jun 23, 2023
2 parents e8f1b44 + 999466d commit cdb021d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@ impl Project {
// TODO: Do this smarter. E.g.:
// - split this into an object if exotic properties (like channel) are specified.
// - split the name from the rest of the requirement.
let spec_string = spec.to_string();
let requirement = spec_string.split_once(' ').unwrap_or(("", "*")).1;
let nameless = NamelessMatchSpec::from(spec.to_owned());

// Store (or replace) in the document
deps_table.insert(name, Item::Value(requirement.into()));
deps_table.insert(name, Item::Value(nameless.to_string().into()));

self.manifest
.dependencies
.insert(name.to_string(), nameless);

Ok(())
}
Expand Down

0 comments on commit cdb021d

Please sign in to comment.