summaryrefslogtreecommitdiff
path: root/cli/standalone
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-15 20:59:16 +0100
committerGitHub <noreply@github.com>2024-08-15 21:59:16 +0200
commite8d57cd3feb169c6a8e9cb11d96c0f2d0b7d50f8 (patch)
treeaaaa9aa09a41888d2b09167c30eda3e0b07d4036 /cli/standalone
parent8749d651fb5e0964cdb8e62be7a59a603cbc3c7c (diff)
refactor: remove version::is_canary(), use ReleaseChannel instead (#25053)
In preparation for https://github.com/denoland/deno/pull/25014, this commit removes public `is_canary()` method and instead uses an enum `ReleaseChannel` to be able to designate more "kinds" of builds.
Diffstat (limited to 'cli/standalone')
-rw-r--r--cli/standalone/binary.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs
index 9d6d5262e..bbb3a66c1 100644
--- a/cli/standalone/binary.rs
+++ b/cli/standalone/binary.rs
@@ -53,6 +53,7 @@ use crate::file_fetcher::FileFetcher;
use crate::http_util::HttpClientProvider;
use crate::npm::CliNpmResolver;
use crate::npm::InnerCliNpmResolverRef;
+use crate::shared::ReleaseChannel;
use crate::standalone::virtual_fs::VfsEntry;
use crate::util::archive;
use crate::util::fs::canonicalize_path_maybe_not_exists;
@@ -416,10 +417,17 @@ impl<'a> DenoCompileBinaryWriter<'a> {
let target = compile_flags.resolve_target();
let binary_name = format!("denort-{target}.zip");
- let binary_path_suffix = if crate::version::is_canary() {
- format!("canary/{}/{}", crate::version::GIT_COMMIT_HASH, binary_name)
- } else {
- format!("release/v{}/{}", env!("CARGO_PKG_VERSION"), binary_name)
+ let binary_path_suffix = match crate::version::RELEASE_CHANNEL {
+ ReleaseChannel::Canary => {
+ format!("canary/{}/{}", crate::version::GIT_COMMIT_HASH, binary_name)
+ }
+ ReleaseChannel::Stable => {
+ format!("release/v{}/{}", env!("CARGO_PKG_VERSION"), binary_name)
+ }
+ _ => bail!(
+ "`deno compile` current doesn't support {} release channel",
+ crate::version::RELEASE_CHANNEL.name()
+ ),
};
let download_directory = self.deno_dir.dl_folder_path();