Skip to content

Commit

Permalink
Move env vars to Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeda-ks committed Apr 26, 2023
1 parent f09057d commit 693c526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions cli/internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package run
import (
gocontext "context"
"fmt"
"os"
"sort"
"sync"
"time"
Expand Down Expand Up @@ -130,14 +129,6 @@ func optsFromArgs(args *turbostate.ParsedArgsFromRust) (*Opts, error) {
}

func configureRun(base *cmdutil.CmdBase, opts *Opts, signalWatcher *signals.Watcher) *run {
if os.Getenv("TURBO_FORCE") == "true" {
opts.runcacheOpts.SkipReads = true
}

if os.Getenv("TURBO_REMOTE_ONLY") == "true" {
opts.cacheOpts.SkipFilesystem = true
}

processes := process.NewManager(base.Logger.Named("processes"))
signalWatcher.AddOnClose(processes.Close)
return &run{
Expand Down
8 changes: 4 additions & 4 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ pub struct RunArgs {
#[clap(short = 'F', long, action = ArgAction::Append)]
pub filter: Vec<String>,
/// Ignore the existing cache (to force execution)
#[clap(long)]
pub force: bool,
#[clap(long, env = "TURBO_FORCE", default_missing_value = "false")]
pub force: Option<Option<bool>>,
/// Specify glob of global filesystem dependencies to be hashed. Useful
/// for .env and files
#[clap(long = "global-deps", action = ArgAction::Append)]
Expand Down Expand Up @@ -365,8 +365,8 @@ pub struct RunArgs {
pub profile: Option<String>,
/// Ignore the local filesystem cache for all tasks. Only
/// allow reading and caching artifacts using the remote cache.
#[clap(long)]
pub remote_only: bool,
#[clap(long, env = "TURBO_REMOTE_ONLY", default_missing_value = "false")]
pub remote_only: Option<Option<bool>>,
/// Specify package(s) to act as entry points for task execution.
/// Supports globs.
#[clap(long)]
Expand Down

0 comments on commit 693c526

Please sign in to comment.