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

fix: Fix proto setup issues. #667

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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