Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from b3nj5m1n/embed-init
Embed init
- Loading branch information
Showing
6 changed files
with
119 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use super::settings::InitMode; | ||
|
||
pub struct Init {} | ||
|
||
impl Init { | ||
pub fn new(init_mode: &InitMode) -> Self { | ||
match init_mode { | ||
InitMode::Bash => { | ||
Init::init_bash(); | ||
} | ||
InitMode::Zsh => { | ||
Init::init_zsh(); | ||
} | ||
InitMode::Fish => { | ||
Init::init_fish(); | ||
} | ||
} | ||
Self {} | ||
} | ||
pub fn init_bash() { | ||
let script = include_str!("../mcfly.bash"); | ||
print!("{}", script); | ||
} | ||
pub fn init_zsh() { | ||
let script = include_str!("../mcfly.zsh"); | ||
print!("{}", script); | ||
} | ||
pub fn init_fish() { | ||
let script = include_str!("../mcfly.fish"); | ||
print!("{}", script); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters