|
|
@ -2,6 +2,7 @@ use colored::Colorize;
|
|
|
|
use spinoff::{Color, Spinner, Spinners};
|
|
|
|
use spinoff::{Color, Spinner, Spinners};
|
|
|
|
use std::env;
|
|
|
|
use std::env;
|
|
|
|
use std::fmt::Write;
|
|
|
|
use std::fmt::Write;
|
|
|
|
|
|
|
|
use std::path::Path;
|
|
|
|
use std::process::Command;
|
|
|
|
use std::process::Command;
|
|
|
|
use tabled::Tabled;
|
|
|
|
use tabled::Tabled;
|
|
|
|
|
|
|
|
|
|
|
@ -116,6 +117,17 @@ pub fn info(verbose: bool) {
|
|
|
|
let mut repos_git = vec![];
|
|
|
|
let mut repos_git = vec![];
|
|
|
|
|
|
|
|
|
|
|
|
if git_info {
|
|
|
|
if git_info {
|
|
|
|
|
|
|
|
// Crash early if directories are not found for git_info
|
|
|
|
|
|
|
|
for repo in &repos_unparsed {
|
|
|
|
|
|
|
|
if !Path::new(&repo.name).exists() {
|
|
|
|
|
|
|
|
crash!(
|
|
|
|
|
|
|
|
AppExitCode::RepoParseError,
|
|
|
|
|
|
|
|
"Failed to check directory {} for Git info, have you initialized the repo?",
|
|
|
|
|
|
|
|
repo.name,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Start the spinner
|
|
|
|
// Start the spinner
|
|
|
|
let sp = Spinner::new(
|
|
|
|
let sp = Spinner::new(
|
|
|
|
Spinners::Line,
|
|
|
|
Spinners::Line,
|
|
|
@ -133,7 +145,7 @@ pub fn info(verbose: bool) {
|
|
|
|
\n\
|
|
|
|
\n\
|
|
|
|
# This script will run `git remote update` in all repositories\n\
|
|
|
|
# This script will run `git remote update` in all repositories\n\
|
|
|
|
pull() { cd $1; git remote update; cd -; }\n\
|
|
|
|
pull() { cd $1; git remote update; cd -; }\n\
|
|
|
|
\n"
|
|
|
|
\n",
|
|
|
|
);
|
|
|
|
);
|
|
|
|
for repo in &repos_unparsed {
|
|
|
|
for repo in &repos_unparsed {
|
|
|
|
writeln!(bash_script, "pull {} &", repo.name).unwrap();
|
|
|
|
writeln!(bash_script, "pull {} &", repo.name).unwrap();
|
|
|
@ -149,14 +161,8 @@ pub fn info(verbose: bool) {
|
|
|
|
.output()
|
|
|
|
.output()
|
|
|
|
.unwrap();
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
// Because spinoff requires &'static str, we need to Box these in the heap and then leak them to be able to format the spinner
|
|
|
|
// Stop the spinner with a success message
|
|
|
|
let symbol = Box::new(format!("{}", "✔".bold().green()));
|
|
|
|
sp.success(&"Done!".bold());
|
|
|
|
let done = Box::new(format!("{}", "Done!".bold()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let symbol: &'static str = Box::leak(symbol);
|
|
|
|
|
|
|
|
let done: &'static str = Box::leak(done);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sp.stop_and_persist(symbol, done);
|
|
|
|
|
|
|
|
log!(verbose, "Repos: {:?}", repos);
|
|
|
|
log!(verbose, "Repos: {:?}", repos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|