summaryrefslogtreecommitdiff
path: root/src/version.rs
blob: df9cfc58b5b879aa175cdabd5f0981ed8ada382b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
use libdeno;
use std::ffi::CStr;

// This is the source of truth for the Deno version. Ignore the value in Cargo.toml.
const DENO_VERSION: &str = "0.1.7";

pub fn print_version() {
  let v = unsafe { libdeno::deno_v8_version() };
  let c_str = unsafe { CStr::from_ptr(v) };
  let version = c_str.to_str().unwrap();
  println!("deno: {}", DENO_VERSION);
  println!("v8: {}", version);
}