Skip to content

Commit

Permalink
fix: Fix proto setup issues. (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Dec 2, 2024
1 parent 865b03c commit ff5a0c6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
- Added support for `~/.netrc` configuration to all HTTP requests.
- Improved implementation of HTTP request/response caching. Now takes into account [HTTP cache semantics](https://github.com/kornelski/rusty-http-cache-semantics).
- Updated `proto upgrade` to error if there's another process of proto currently running.
- Updated `proto setup` to default to a fallback shell if none could be detected, instead of erroring.

#### 🐞 Fixes

- Fixed the order of shell profiles/configs when applicable.
- Updated `proto setup` to inherit `PROTO_HOME` if already set, instead of defaulting to `$HOME/.proto`.

#### ⚙️ Internal

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ starbase_archive = { version = "0.8.10", features = [
] }
starbase_events = { version = "0.6.3" }
starbase_sandbox = { version = "0.7.7" }
starbase_shell = { version = "0.6.3", features = ["miette"] }
starbase_shell = { version = "0.6.4", features = ["miette"] }
starbase_styles = { version = "0.4.6" }
starbase_utils = { version = "0.8.13", default-features = false, features = [
"json",
Expand Down
9 changes: 6 additions & 3 deletions crates/cli/src/commands/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::shell::{
use clap::Args;
use proto_shim::get_exe_file_name;
use starbase::AppResult;
use starbase_shell::{BoxedShell, ShellError, ShellType};
use starbase_shell::{BoxedShell, ShellType};
use starbase_styles::color;
use std::env;
use std::io::stdout;
Expand Down Expand Up @@ -70,7 +70,7 @@ pub async fn setup(session: ProtoSession, args: SetupArgs) -> AppResult {

prompt_for_shell()?
} else {
return Err(ShellError::CouldNotDetectShell.into());
ShellType::default()
}
}
};
Expand All @@ -83,7 +83,10 @@ pub async fn setup(session: ProtoSession, args: SetupArgs) -> AppResult {
&shell,
"proto",
vec![
Export::Var("PROTO_HOME".into(), "$HOME/.proto".into()),
Export::Var(
"PROTO_HOME".into(),
env::var("PROTO_HOME").unwrap_or_else(|_| "$HOME/.proto".into()),
),
Export::Path(vec!["$PROTO_HOME/shims".into(), "$PROTO_HOME/bin".into()]),
],
);
Expand Down

0 comments on commit ff5a0c6

Please sign in to comment.