summaryrefslogtreecommitdiff
path: root/cli/standalone
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-15 22:47:16 +0100
committerGitHub <noreply@github.com>2024-08-15 23:47:16 +0200
commit2bb013f9baa927fc7b392766b0182b91380b9aa8 (patch)
treeca8a7ea961b50213adf0904d724974c317cefb55 /cli/standalone
parent5ec3c5c3a46ca95f355a4520676b85ac619ca102 (diff)
refactor: `version` module exports a single const struct (#25014)
This commit rewrites the internal `version` module that exported various information about the current executable. Instead of exporting several consts, we are now exporting a single const structure that contains all the necessary information. This is the first step towards cleaning up how we use this information and should allow us to use SUI to be able to patch this information in already produced binary making it easier to cut new releases. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/standalone')
-rw-r--r--cli/standalone/binary.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs
index bbb3a66c1..168310efd 100644
--- a/cli/standalone/binary.rs
+++ b/cli/standalone/binary.rs
@@ -417,18 +417,23 @@ impl<'a> DenoCompileBinaryWriter<'a> {
let target = compile_flags.resolve_target();
let binary_name = format!("denort-{target}.zip");
- 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 binary_path_suffix =
+ match crate::version::DENO_VERSION_INFO.release_channel {
+ ReleaseChannel::Canary => {
+ format!(
+ "canary/{}/{}",
+ crate::version::DENO_VERSION_INFO.git_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::DENO_VERSION_INFO.release_channel.name()
+ ),
+ };
let download_directory = self.deno_dir.dl_folder_path();
let binary_path = download_directory.join(&binary_path_suffix);