Skip to content

feat: deno upgrade --rc #24905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "deno"
version = "1.45.5"
version = "2.0.0-rc.0"
authors.workspace = true
default-run = "deno"
edition.workspace = true
Expand Down
38 changes: 38 additions & 0 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ pub struct TestFlags {
pub struct UpgradeFlags {
pub dry_run: bool,
pub force: bool,
pub release_candidate: bool,
pub canary: bool,
pub version: Option<String>,
pub output: Option<String>,
Expand Down Expand Up @@ -2880,6 +2881,13 @@ update to a different location, use the --output flag
.help("Upgrade to canary builds")
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("release_candidate")
.long("rc")
.help("Upgrade to Deno 2 release candidate")
.conflicts_with_all(["canary", "version"])
.action(ArgAction::SetTrue),
)
.arg(ca_file_arg())
})
}
Expand Down Expand Up @@ -4646,11 +4654,13 @@ fn upgrade_parse(flags: &mut Flags, matches: &mut ArgMatches) {
let dry_run = matches.get_flag("dry-run");
let force = matches.get_flag("force");
let canary = matches.get_flag("canary");
let release_candidate = matches.get_flag("release_candidate");
let version = matches.remove_one::<String>("version");
let output = matches.remove_one::<String>("output");
flags.subcommand = DenoSubcommand::Upgrade(UpgradeFlags {
dry_run,
force,
release_candidate,
canary,
version,
output,
Expand Down Expand Up @@ -5137,6 +5147,7 @@ mod tests {
force: true,
dry_run: true,
canary: false,
release_candidate: false,
version: None,
output: None,
}),
Expand All @@ -5155,6 +5166,7 @@ mod tests {
force: false,
dry_run: false,
canary: false,
release_candidate: false,
version: None,
output: Some(String::from("example.txt")),
}),
Expand Down Expand Up @@ -9060,6 +9072,7 @@ mod tests {
force: false,
dry_run: false,
canary: false,
release_candidate: false,
version: None,
output: None,
}),
Expand All @@ -9069,6 +9082,31 @@ mod tests {
);
}

#[test]
fn upgrade_release_candidate() {
let r = flags_from_vec(svec!["deno", "upgrade", "--rc"]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
force: false,
dry_run: false,
canary: false,
release_candidate: true,
version: None,
output: None,
}),
..Flags::default()
}
);

let r = flags_from_vec(svec!["deno", "upgrade", "--rc", "--canary"]);
assert!(r.is_err());

let r = flags_from_vec(svec!["deno", "upgrade", "--rc", "--version"]);
assert!(r.is_err());
}

#[test]
fn cache_with_cafile() {
let r = flags_from_vec(svec![
Expand Down
Loading
Loading