Skip to content

Commit

Permalink
feat: implemented --update-path
Browse files Browse the repository at this point in the history
  • Loading branch information
VarunPotti committed Apr 23, 2022
1 parent 0456905 commit 9692781
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
rustc-wrapper = 'C:\Users\potti\.cargo\bin\sccache'
rustc-wrapper = '/home/varun/.cargo/sccache'
[target.x86_64-unknown-linux-gnu]
rustflags = [
'-Clink-arg=-fuse-ld=lld',
Expand Down
2 changes: 1 addition & 1 deletion 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 fleet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ rd_enabled = true
fleet_id = "19f92877-035d-4689-b984-dcc1593505a2"

[build]
sccache = "C:\\Users\\potti\\.cargo\\bin\\sccache"
sccache = "/home/varun/.cargo/sccache"
17 changes: 12 additions & 5 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ impl CLI {
if let Ok(cargo_home) = cargo_home_path {
cargo_path = PathBuf::from(cargo_home).join("bin");
}

// check if sccache is installed
let mut sccache_path = cargo_path.join("sccache");
if cfg!(windows){
sccache_path = cargo_path.join("sccache.exe");
if cfg!(windows) {
sccache_path = cargo_path.join("sccache.exe");
}

if !sccache_path.exists() {
Expand Down Expand Up @@ -140,8 +140,9 @@ The blazing fast build tool for Rust.
fleet <SUBCOMMAND>
{}:
-h, --help Print help information
-V, --version Print version information
-h, --help Print help information
-v, --version Print version information
-up, --update-path Update paths in .cargo/config.toml
{}:
build Build a Fleet project
Expand Down Expand Up @@ -180,6 +181,12 @@ The blazing fast build tool for Rust.
println!("{}", VERSION);
std::process::exit(1)
}

if args.contains(&String::from("--update-path")) || args.contains(&String::from("-up"))
{
init(app);
std::process::exit(1)
}
match cmd.as_str() {
"run" => {
init(app);
Expand Down

0 comments on commit 9692781

Please sign in to comment.