feat: support oh-my-bash (#425)
This commit is contained in:
@@ -342,6 +342,7 @@ For more information about this issue see https://askubuntu.com/questions/110969
|
|||||||
runner.execute(Step::Shell, "zi", || zsh::run_zi(run_type))?;
|
runner.execute(Step::Shell, "zi", || zsh::run_zi(run_type))?;
|
||||||
runner.execute(Step::Shell, "zim", || zsh::run_zim(run_type))?;
|
runner.execute(Step::Shell, "zim", || zsh::run_zim(run_type))?;
|
||||||
runner.execute(Step::Shell, "oh-my-zsh", || zsh::run_oh_my_zsh(&ctx))?;
|
runner.execute(Step::Shell, "oh-my-zsh", || zsh::run_oh_my_zsh(&ctx))?;
|
||||||
|
runner.execute(Step::Shell, "oh-my-bash", || unix::run_oh_my_bash(&ctx))?;
|
||||||
runner.execute(Step::Shell, "fisher", || unix::run_fisher(run_type))?;
|
runner.execute(Step::Shell, "fisher", || unix::run_fisher(run_type))?;
|
||||||
runner.execute(Step::Shell, "bash-it", || unix::run_bashit(&ctx))?;
|
runner.execute(Step::Shell, "bash-it", || unix::run_bashit(&ctx))?;
|
||||||
runner.execute(Step::Shell, "oh-my-fish", || unix::run_oh_my_fish(&ctx))?;
|
runner.execute(Step::Shell, "oh-my-fish", || unix::run_oh_my_fish(&ctx))?;
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ use std::fs;
|
|||||||
use std::os::unix::fs::MetadataExt;
|
use std::os::unix::fs::MetadataExt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::{env, path::Path};
|
use std::{
|
||||||
|
env::{self, var},
|
||||||
|
path::Path,
|
||||||
|
};
|
||||||
|
|
||||||
use crate::command::CommandExt;
|
use crate::command::CommandExt;
|
||||||
use crate::{Step, HOME_DIR};
|
use crate::{Step, HOME_DIR};
|
||||||
@@ -136,6 +139,27 @@ pub fn run_bashit(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
.status_checked()
|
.status_checked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn run_oh_my_bash(ctx: &ExecutionContext) -> Result<()> {
|
||||||
|
require("bash")?;
|
||||||
|
let oh_my_bash = var("OSH")
|
||||||
|
// default to `~/.oh-my-bash`
|
||||||
|
.unwrap_or(
|
||||||
|
HOME_DIR
|
||||||
|
.join(".oh-my-bash")
|
||||||
|
.to_str()
|
||||||
|
.expect("should be UTF-8 encoded")
|
||||||
|
.to_string(),
|
||||||
|
)
|
||||||
|
.require()?;
|
||||||
|
|
||||||
|
print_separator("oh-my-bash");
|
||||||
|
|
||||||
|
let mut update_script = oh_my_bash;
|
||||||
|
update_script.push_str("tools/upgrade.sh");
|
||||||
|
|
||||||
|
ctx.run_type().execute("bash").arg(update_script).status_checked()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn run_oh_my_fish(ctx: &ExecutionContext) -> Result<()> {
|
pub fn run_oh_my_fish(ctx: &ExecutionContext) -> Result<()> {
|
||||||
let fish = require("fish")?;
|
let fish = require("fish")?;
|
||||||
HOME_DIR.join(".local/share/omf/pkg/omf/functions/omf.fish").require()?;
|
HOME_DIR.join(".local/share/omf/pkg/omf/functions/omf.fish").require()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user