Fmt and whatnot

main
Michal 2 years ago
parent 44627c25fc
commit 6694c50c4d
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -1,6 +1,6 @@
use crate::{crash, info, log, repository, workspace};
use crate::internal::AppExitCode;
use crate::internal::structs::{ErroredPackage, Repo}; use crate::internal::structs::{ErroredPackage, Repo};
use crate::internal::AppExitCode;
use crate::{crash, info, log, repository, workspace};
pub fn build(packages: Vec<String>, exclude: Vec<String>, no_regen: bool, verbose: bool) { pub fn build(packages: Vec<String>, exclude: Vec<String>, no_regen: bool, verbose: bool) {
// Read config struct from mlc.toml // Read config struct from mlc.toml

@ -2,12 +2,12 @@ pub use build::*;
pub use clean::*; pub use clean::*;
pub use clone::*; pub use clone::*;
pub use config::*; pub use config::*;
pub use pull::*;
pub use prune::*; pub use prune::*;
pub use pull::*;
mod build; mod build;
mod clean; mod clean;
mod clone; mod clone;
mod config; mod config;
mod prune;
mod pull; mod pull;
mod prune;

@ -1,9 +1,9 @@
use std::env;
use std::path::PathBuf;
use std::fs;
use crate::info; use crate::info;
use crate::log; use crate::log;
use crate::read_cfg; use crate::read_cfg;
use std::env;
use std::fs;
use std::path::PathBuf;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
struct PackageFile { struct PackageFile {
@ -97,9 +97,8 @@ pub fn prune(verbose: bool) {
for p in packages_to_delete.iter() { for p in packages_to_delete.iter() {
let path = format!("{}-{}-{}", p.name, p.ver, p.ext); let path = format!("{}-{}-{}", p.name, p.ver, p.ext);
log!(verbose, "Deleting {}", path); log!(verbose, "Deleting {}", path);
std::process::Command::new("bash").args(&["-c", std::process::Command::new("bash")
&format!("rm -rf ./{} ./{}.sig", path, path) .args(&["-c", &format!("rm -rf ./{} ./{}.sig", path, path)])
])
.output() .output()
.unwrap(); .unwrap();
} }
@ -113,4 +112,4 @@ pub fn prune(verbose: bool) {
for p in packages_to_delete.iter_mut() { for p in packages_to_delete.iter_mut() {
info!("{}-{}-{}", p.name, p.ver, p.ext); info!("{}-{}-{}", p.name, p.ver, p.ext);
} }
} }

@ -1,8 +1,8 @@
use std::env; use std::env;
use std::process::Command; use std::process::Command;
use crate::{crash, internal::AppExitCode, log};
use crate::info; use crate::info;
use crate::{crash, internal::AppExitCode, log};
fn do_the_pulling(repos: Vec<String>, verbose: bool) { fn do_the_pulling(repos: Vec<String>, verbose: bool) {
for repo in repos { for repo in repos {

@ -3,8 +3,8 @@ use std::fs::File;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
use crate::{crash, log};
use crate::internal::AppExitCode; use crate::internal::AppExitCode;
use crate::{crash, log};
const DEFAULT_CONFIG: &str = r#" const DEFAULT_CONFIG: &str = r#"
# Either "repository" or "workspace" # Either "repository" or "workspace"

@ -1,9 +1,9 @@
use std::{env, fs};
use std::path::Path; use std::path::Path;
use std::process::Command; use std::process::Command;
use std::{env, fs};
use crate::{crash, log};
use crate::internal::AppExitCode; use crate::internal::AppExitCode;
use crate::{crash, log};
pub fn build(pkg: &str, sign: bool, verbose: bool) -> i32 { pub fn build(pkg: &str, sign: bool, verbose: bool) -> i32 {
log!(verbose, "Building {}", pkg); log!(verbose, "Building {}", pkg);

@ -1,6 +1,6 @@
use std::{env, fs};
use std::path::Path; use std::path::Path;
use std::process::Command; use std::process::Command;
use std::{env, fs};
use crate::{log, workspace::read_cfg}; use crate::{log, workspace::read_cfg};

@ -1,9 +1,9 @@
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
use crate::{crash, log};
use crate::internal::AppExitCode;
use crate::internal::structs::{Config, Repo, SplitRepo, UnexpandedConfig}; use crate::internal::structs::{Config, Repo, SplitRepo, UnexpandedConfig};
use crate::internal::AppExitCode;
use crate::{crash, log};
pub fn read_cfg(verbose: bool) -> Config { pub fn read_cfg(verbose: bool) -> Config {
// Crash if mlc.toml doesn't exist // Crash if mlc.toml doesn't exist

Loading…
Cancel
Save