ksud: unify version

This commit is contained in:
tiann
2023-02-03 19:34:19 +08:00
parent ed2176af8c
commit aa73c34db2
4 changed files with 51 additions and 2 deletions

View File

@@ -6,11 +6,11 @@ use android_logger::Config;
#[cfg(target_os = "android")]
use log::LevelFilter;
use crate::{apk_sign, debug, event, module};
use crate::{apk_sign, debug, defs, event, module};
/// KernelSU userspace cli
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
#[command(author, version = defs::VERSION_NAME, about, long_about = None)]
struct Args {
#[command(subcommand)]
command: Commands,

View File

@@ -19,3 +19,7 @@ pub const MODULE_UPDATE_TMP_DIR: &str = concatcp!(WORKING_DIR, "modules_update/"
pub const DISABLE_FILE_NAME: &str = "disable";
pub const UPDATE_FILE_NAME: &str = "update";
pub const REMOVE_FILE_NAME: &str = "remove";
pub const VERSION_CODE: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_CODE"));
pub const VERSION_NAME: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_NAME"));

View File

@@ -209,6 +209,8 @@ fn exec_script<T: AsRef<Path>>(path: T, wait: bool) -> Result<()> {
.arg("sh")
.arg(path.as_ref())
.env("ASH_STANDALONE", "1")
.env("KSU_VER_CODE", defs::VERSION_CODE)
.env("KSU_VER", defs::VERSION_NAME)
.env(
"PATH",
format!("{}:{}", env_var("PATH").unwrap(), defs::BINARY_DIR),