-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01ca8e8
commit 8923830
Showing
11 changed files
with
51 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
oxido | ||
oxido* | ||
target | ||
Cargo.lock | ||
bin |
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
use crate::{shell_command}; | ||
use regex::Regex; | ||
use crate::{shell_command, current_shell}; | ||
|
||
pub fn install_l() { | ||
|
||
let mut s = shell_command( | ||
"curl", | ||
vec![ | ||
"https://api.github.com/repositories/500013933/releases/latest", | ||
], | ||
vec!["https://api.github.com/repositories/500013933/releases/latest"], | ||
); | ||
|
||
let re = Regex::new("\"browser_download_url\":.\"(?P<url>.*tar.gz)\"").unwrap(); | ||
|
||
s = re.captures(&s).unwrap().name("url").unwrap().as_str().to_string(); | ||
s = re | ||
.captures(&s) | ||
.unwrap() | ||
.name("url") | ||
.unwrap() | ||
.as_str() | ||
.to_string(); | ||
|
||
println!("Downloading release from {}...", &s); | ||
|
||
shell_command("wget", vec![&s]); | ||
|
||
println!("Unpacking release..."); | ||
|
||
shell_command("tar", vec!["-xf", "oxido*.tar.gz"]); | ||
|
||
println!("Moving to $HOME/.oxido..."); | ||
|
||
shell_command("mkdir", vec!["$HOME/.oxido"]); | ||
shell_command("mv", vec!["oxido* $HOME/.oxido"]); | ||
shell_command("export", vec!["PATH:$HOME/.oxido"]); | ||
|
||
if current_shell() == "bash" { | ||
shell_command("echo", vec!["\"export PATH:$HOME/.oxido\" >> $HOME/.bashrc"]); | ||
} else if current_shell() == "zsh" { | ||
shell_command("echo", vec!["\"export PATH:$HOME/.oxido\" >> $HOME/.zshrc"]); | ||
} | ||
|
||
} | ||
|
||
println!("Oxup installed successfully!\nRun echo \"export PATH=\"$HOME/.oxido:$PATH\"\" >> $HOME/.bashrc and restart your terminal to use it"); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod linux; | ||
pub mod macos; | ||
pub mod windows; | ||
pub mod macos; | ||
pub mod windows; |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ use crate::shell_command; | |
|
||
pub fn uninstall_l() { | ||
shell_command("rm", vec!["-rf", "$HOME/.oxido/oxido"]); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ use crate::shell_command; | |
|
||
pub fn uninstall_m() { | ||
shell_command("rm", vec!["-rf", "$HOME/.oxido/oxido"]); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod linux; | ||
pub mod macos; | ||
pub mod windows; | ||
pub mod macos; | ||
pub mod windows; |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ use crate::shell_command; | |
|
||
pub fn uninstall_w() { | ||
shell_command("rm", vec![r"C:\bin\oxido"]); | ||
} | ||
} |