Skip to content

Commit b879f11

Browse files
committed
Deprecate drone env
1 parent 65fc39c commit b879f11

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Possible log types:
1515

1616
- [changed] `drone new` generates a more IDE-friendly project with all rustflags
1717
stored in `.cargo/config`
18+
- [deprecated] `drone env` command is now deprecated
1819

1920
### v0.13.0 (2020-11-28)
2021

src/cmd/env.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//! `drone env` command.
22
3-
use crate::cli::EnvCmd;
3+
use crate::{cli::EnvCmd, color::Color};
4+
use ansi_term::Color::Yellow;
45
use anyhow::{anyhow, bail, Result};
56
use std::{env, os::unix::process::CommandExt, process::Command};
67

78
/// Runs `drone env` command.
8-
pub fn run(cmd: EnvCmd) -> Result<()> {
9+
pub fn run(cmd: EnvCmd, color: Color) -> Result<()> {
10+
eprintln!("{}: `drone env` command is deprecated", color.bold_fg("warning", Yellow));
911
let EnvCmd { target, command } = cmd;
1012
let mut iter = command.iter();
1113
if let Some(command) = iter.next() {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Cli {
8080
.filter(None, Level::Warn.to_level_filter())
8181
.try_init()?;
8282
match cmd {
83-
Cmd::Env(cmd) => cmd::env(cmd),
83+
Cmd::Env(cmd) => cmd::env(cmd, color),
8484
Cmd::Flash(cmd) => cmd::flash(cmd),
8585
Cmd::Gdb(cmd) => cmd::gdb(cmd),
8686
Cmd::Heap(cmd) => cmd::heap(cmd, color),

0 commit comments

Comments
 (0)