wip rebase deno-rm-upgrade-cmd.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/deno?expand=0&rev=169
This commit is contained in:
@@ -22,7 +22,23 @@ diff --git a/cli/args/flags.rs.1 b/cli/args/flags.rs
|
||||
index 72841df..1c93da1 100644
|
||||
--- a/cli/args/flags.rs.1
|
||||
+++ b/cli/args/flags.rs
|
||||
@@ -328,7 +328,6 @@ pub enum DenoSubcommand {
|
||||
@@ -281,15 +281,6 @@ pub struct TestFlags {
|
||||
pub junit_path: Option<String>,
|
||||
}
|
||||
|
||||
-#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
-pub struct UpgradeFlags {
|
||||
- pub dry_run: bool,
|
||||
- pub force: bool,
|
||||
- pub canary: bool,
|
||||
- pub version: Option<String>,
|
||||
- pub output: Option<PathBuf>,
|
||||
-}
|
||||
-
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct VendorFlags {
|
||||
pub specifiers: Vec<String>,
|
||||
@@ -328,7 +319,6 @@ pub enum DenoSubcommand {
|
||||
Task(TaskFlags),
|
||||
Test(TestFlags),
|
||||
Types,
|
||||
@@ -30,7 +46,7 @@ index 72841df..1c93da1 100644
|
||||
Vendor(VendorFlags),
|
||||
Publish(PublishFlags),
|
||||
}
|
||||
@@ -760,7 +759,7 @@ impl Flags {
|
||||
@@ -760,7 +750,7 @@ impl Flags {
|
||||
std::env::current_dir().ok()
|
||||
}
|
||||
Bundle(_) | Completions(_) | Doc(_) | Fmt(_) | Init(_) | Install(_)
|
||||
@@ -39,7 +55,7 @@ index 72841df..1c93da1 100644
|
||||
| Vendor(_) | Publish(_) => None,
|
||||
}
|
||||
}
|
||||
@@ -944,7 +943,6 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> {
|
||||
@@ -944,7 +934,6 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> {
|
||||
"test" => test_parse(&mut flags, &mut m),
|
||||
"types" => types_parse(&mut flags, &mut m),
|
||||
"uninstall" => uninstall_parse(&mut flags, &mut m),
|
||||
@@ -47,7 +63,7 @@ index 72841df..1c93da1 100644
|
||||
"vendor" => vendor_parse(&mut flags, &mut m),
|
||||
"publish" => publish_parse(&mut flags, &mut m),
|
||||
_ => unreachable!(),
|
||||
@@ -1099,7 +1097,6 @@ fn clap_root() -> Command {
|
||||
@@ -1099,7 +1088,6 @@ fn clap_root() -> Command {
|
||||
.subcommand(task_subcommand())
|
||||
.subcommand(test_subcommand())
|
||||
.subcommand(types_subcommand())
|
||||
@@ -55,3 +71,151 @@ index 72841df..1c93da1 100644
|
||||
.subcommand(vendor_subcommand())
|
||||
})
|
||||
.long_about(DENO_HELP)
|
||||
@@ -2262,61 +2250,6 @@ The declaration file could be saved and used for typing information.",
|
||||
)
|
||||
}
|
||||
|
||||
-fn upgrade_subcommand() -> Command {
|
||||
- Command::new("upgrade")
|
||||
- .about("Upgrade deno executable to given version")
|
||||
- .long_about(
|
||||
- "Upgrade deno executable to the given version.
|
||||
-Defaults to latest.
|
||||
-
|
||||
-The version is downloaded from
|
||||
-https://github.com/denoland/deno/releases
|
||||
-and is used to replace the current executable.
|
||||
-
|
||||
-If you want to not replace the current Deno executable but instead download an
|
||||
-update to a different location, use the --output flag
|
||||
-
|
||||
- deno upgrade --output $HOME/my_deno",
|
||||
- )
|
||||
- .hide(cfg!(not(feature = "upgrade")))
|
||||
- .defer(|cmd| {
|
||||
- cmd
|
||||
- .arg(
|
||||
- Arg::new("version")
|
||||
- .long("version")
|
||||
- .help("The version to upgrade to"),
|
||||
- )
|
||||
- .arg(
|
||||
- Arg::new("output")
|
||||
- .long("output")
|
||||
- .help("The path to output the updated version to")
|
||||
- // todo(dsherret): remove value_parser!(PathBuf) and instead parse as string
|
||||
- .value_parser(value_parser!(PathBuf))
|
||||
- .value_hint(ValueHint::FilePath),
|
||||
- )
|
||||
- .arg(
|
||||
- Arg::new("dry-run")
|
||||
- .long("dry-run")
|
||||
- .help("Perform all checks without replacing old exe")
|
||||
- .action(ArgAction::SetTrue),
|
||||
- )
|
||||
- .arg(
|
||||
- Arg::new("force")
|
||||
- .long("force")
|
||||
- .short('f')
|
||||
- .help("Replace current exe even if not out-of-date")
|
||||
- .action(ArgAction::SetTrue),
|
||||
- )
|
||||
- .arg(
|
||||
- Arg::new("canary")
|
||||
- .long("canary")
|
||||
- .help("Upgrade to canary builds")
|
||||
- .action(ArgAction::SetTrue),
|
||||
- )
|
||||
- .arg(ca_file_arg())
|
||||
- })
|
||||
-}
|
||||
-
|
||||
fn vendor_subcommand() -> Command {
|
||||
Command::new("vendor")
|
||||
.about("Vendor remote modules into a local directory")
|
||||
@@ -3785,23 +3718,6 @@ fn types_parse(flags: &mut Flags, _matches: &mut ArgMatches) {
|
||||
flags.subcommand = DenoSubcommand::Types;
|
||||
}
|
||||
|
||||
-fn upgrade_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
||||
- ca_file_arg_parse(flags, matches);
|
||||
-
|
||||
- let dry_run = matches.get_flag("dry-run");
|
||||
- let force = matches.get_flag("force");
|
||||
- let canary = matches.get_flag("canary");
|
||||
- let version = matches.remove_one::<String>("version");
|
||||
- let output = matches.remove_one::<PathBuf>("output");
|
||||
- flags.subcommand = DenoSubcommand::Upgrade(UpgradeFlags {
|
||||
- dry_run,
|
||||
- force,
|
||||
- canary,
|
||||
- version,
|
||||
- output,
|
||||
- });
|
||||
-}
|
||||
-
|
||||
fn vendor_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
||||
ca_file_arg_parse(flags, matches);
|
||||
config_args_parse(flags, matches);
|
||||
@@ -4251,25 +4167,6 @@ mod tests {
|
||||
assert_eq!(flags2, flags);
|
||||
}
|
||||
|
||||
- #[test]
|
||||
- fn upgrade() {
|
||||
- let r = flags_from_vec(svec!["deno", "upgrade", "--dry-run", "--force"]);
|
||||
- let flags = r.unwrap();
|
||||
- assert_eq!(
|
||||
- flags,
|
||||
- Flags {
|
||||
- subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
|
||||
- force: true,
|
||||
- dry_run: true,
|
||||
- canary: false,
|
||||
- version: None,
|
||||
- output: None,
|
||||
- }),
|
||||
- ..Flags::default()
|
||||
- }
|
||||
- );
|
||||
- }
|
||||
-
|
||||
#[test]
|
||||
fn version() {
|
||||
let r = flags_from_vec(svec!["deno", "--version"]);
|
||||
@@ -7509,25 +7406,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
- #[test]
|
||||
- fn upgrade_with_ca_file() {
|
||||
- let r = flags_from_vec(svec!["deno", "upgrade", "--cert", "example.crt"]);
|
||||
- assert_eq!(
|
||||
- r.unwrap(),
|
||||
- Flags {
|
||||
- subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
|
||||
- force: false,
|
||||
- dry_run: false,
|
||||
- canary: false,
|
||||
- version: None,
|
||||
- output: None,
|
||||
- }),
|
||||
- ca_data: Some(CaData::File("example.crt".to_owned())),
|
||||
- ..Flags::default()
|
||||
- }
|
||||
- );
|
||||
- }
|
||||
-
|
||||
#[test]
|
||||
fn cache_with_cafile() {
|
||||
let r = flags_from_vec(svec![
|
||||
diff --git a/cli/tools/mod.rs.1 b/cli/tools/mod.rs
|
||||
index 4593092..3247915 100644
|
||||
--- a/cli/tools/mod.rs.1
|
||||
+++ b/cli/tools/mod.rs
|
||||
@@ -17,5 +17,4 @@ pub mod repl;
|
||||
pub mod run;
|
||||
pub mod task;
|
||||
pub mod test;
|
||||
-pub mod upgrade;
|
||||
pub mod vendor;
|
||||
|
Reference in New Issue
Block a user