Skip to content
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

allow embassy-cli not as root #1501

Merged
merged 2 commits into from Jun 7, 2022
Merged

allow embassy-cli not as root #1501

merged 2 commits into from Jun 7, 2022

Conversation

dr-bonez
Copy link
Member

@dr-bonez dr-bonez commented Jun 7, 2022

fixes #523
fixes #1373

@dr-bonez dr-bonez added Bug Something isn't working Enhancement New feature or request start-sdk Issues pertaining to the cli tool for packaging services labels Jun 7, 2022
@dr-bonez dr-bonez added this to the 0.3.1 milestone Jun 7, 2022
@dr-bonez dr-bonez added this to Code Review in EmbassyOS 0.3.1 via automation Jun 7, 2022
@dr-bonez dr-bonez self-assigned this Jun 7, 2022
backend/src/context/cli.rs Show resolved Hide resolved
backend/src/context/sdk.rs Show resolved Hide resolved
backend/src/developer/mod.rs Show resolved Hide resolved
backend/src/error.rs Show resolved Hide resolved
backend/src/util/config.rs Show resolved Hide resolved
backend/src/util/config.rs Show resolved Hide resolved
if !first.contains_key(&k) {
first.insert(k, v);
} else {
let old = first.remove(&k).unwrap(); // because in else of !contains_key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Wouldn't this better to be a match, then there would be no unwrap. I know this is safe, for now, but things change.

match first.remove(&k) {
  None => first.insert(k, v),
  Some(old) => {
    let new = match (old, v) {
                (Value::Object(first), Value::Object(second)) => {
                    Value::Object(merge_configs(first, second))
                }
                (first, _) => first,
            };
            first.insert(k, new);
  }
}

@dr-bonez dr-bonez merged commit 4286edd into master Jun 7, 2022
EmbassyOS 0.3.1 automation moved this from Code Review to Done Jun 7, 2022
@dr-bonez dr-bonez deleted the bugfix/non-root-cli branch July 11, 2022 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement New feature or request start-sdk Issues pertaining to the cli tool for packaging services
Projects
No open projects
2 participants