Set IN_TOPGRADE when running the interactive shell (fix #752)
This commit is contained in:
@@ -1,12 +1,3 @@
|
|||||||
use crate::report::StepResult;
|
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
use crate::utils::which;
|
|
||||||
use chrono::{Local, Timelike};
|
|
||||||
use console::{style, Key, Term};
|
|
||||||
use lazy_static::lazy_static;
|
|
||||||
use log::{debug, error};
|
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
use notify_rust::{Notification, Timeout};
|
|
||||||
use std::cmp::{max, min};
|
use std::cmp::{max, min};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
@@ -15,9 +6,20 @@ use std::path::PathBuf;
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
use chrono::{Local, Timelike};
|
||||||
|
use console::{style, Key, Term};
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
use log::{debug, error};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use notify_rust::{Notification, Timeout};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use which_crate::which;
|
use which_crate::which;
|
||||||
|
|
||||||
|
use crate::report::StepResult;
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
use crate::utils::which;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref TERMINAL: Mutex<Terminal> = Mutex::new(Terminal::new());
|
static ref TERMINAL: Mutex<Terminal> = Mutex::new(Terminal::new());
|
||||||
}
|
}
|
||||||
@@ -33,7 +35,12 @@ pub fn shell() -> &'static str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_shell() {
|
pub fn run_shell() {
|
||||||
Command::new(shell()).spawn().unwrap().wait().unwrap();
|
Command::new(shell())
|
||||||
|
.env("IN_TOPGRADE", "1")
|
||||||
|
.spawn()
|
||||||
|
.unwrap()
|
||||||
|
.wait()
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Terminal {
|
struct Terminal {
|
||||||
|
|||||||
Reference in New Issue
Block a user