Add Android support (#749)
This commit is contained in:
committed by
GitHub
parent
ad4648655f
commit
ebb66e26a4
@@ -186,6 +186,9 @@ fn run() -> Result<()> {
|
|||||||
freebsd::upgrade_packages(sudo.as_ref(), run_type)
|
freebsd::upgrade_packages(sudo.as_ref(), run_type)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
runner.execute(Step::Pkg, "Termux Packages", || android::upgrade_packages(&ctx))?;
|
||||||
|
|
||||||
let emacs = emacs::Emacs::new(&base_dirs);
|
let emacs = emacs::Emacs::new(&base_dirs);
|
||||||
if config.use_predefined_git_repos() {
|
if config.use_predefined_git_repos() {
|
||||||
if config.should_run(Step::Emacs) {
|
if config.should_run(Step::Emacs) {
|
||||||
|
|||||||
31
src/steps/os/android.rs
Normal file
31
src/steps/os/android.rs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
use crate::execution_context::ExecutionContext;
|
||||||
|
use crate::terminal::print_separator;
|
||||||
|
use crate::utils::require;
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
|
pub fn upgrade_packages(ctx: &ExecutionContext) -> Result<()> {
|
||||||
|
let pkg = require("pkg")?;
|
||||||
|
|
||||||
|
print_separator("Termux Packages");
|
||||||
|
|
||||||
|
let mut command = ctx.run_type().execute(&pkg);
|
||||||
|
command.arg("upgrade");
|
||||||
|
if ctx.config().yes() {
|
||||||
|
command.arg("-y");
|
||||||
|
}
|
||||||
|
command.check_run()?;
|
||||||
|
|
||||||
|
if ctx.config().cleanup() {
|
||||||
|
ctx.run_type().execute(&pkg).arg("clean").check_run()?;
|
||||||
|
|
||||||
|
let apt = require("apt")?;
|
||||||
|
let mut command = ctx.run_type().execute(&apt);
|
||||||
|
command.arg("autoremove");
|
||||||
|
if ctx.config().yes() {
|
||||||
|
command.arg("-y");
|
||||||
|
}
|
||||||
|
command.check_run()?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#[cfg(target_os = "android")]
|
||||||
|
pub mod android;
|
||||||
#[cfg(target_os = "dragonfly")]
|
#[cfg(target_os = "dragonfly")]
|
||||||
pub mod dragonfly;
|
pub mod dragonfly;
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
|
|||||||
Reference in New Issue
Block a user