Compare commits

..

No commits in common. "5015de5c5274d9f057369e2acb22576164a86e54" and "1d20205fc9292a17b12dff20bde967b1baf6b76b" have entirely different histories.

4 changed files with 9 additions and 10 deletions

2
Cargo.lock generated
View file

@ -290,7 +290,7 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]]
name = "ppi"
version = "1.1.4"
version = "1.1.2"
dependencies = [
"clap",
"dirs",

View file

@ -1,6 +1,6 @@
[package]
name = "ppi"
version = "1.1.4"
version = "1.1.3"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,7 +1,7 @@
# Maintainer: Pagwin <spam@pagwin.xyz>
pkgname='ppi-git'
_name='ppi'
pkgver='1.1.4'
pkgver='1.1.3'
pkgrel='1'
pkgdesc="Pagwin's project initializer, a program which makes setting up project scaffolding easy"
# I could set this to any or all the archictectures but I can't easily test for those so change this if needed

View file

@ -21,7 +21,7 @@ struct Config{
subcommands: Subcommands
}
#[allow(dead_code)]
#[derive(Debug)]
enum Errors{IoErr(std::io::Error), GitErr(git2::Error), CliErr(CliError), Unknown}
impl From<std::io::Error> for Errors {
@ -103,6 +103,7 @@ fn main() -> Result<(),Errors> {
#[cfg(debug_assertions)]
{
eprintln!("repo cloned");
std::io::stdin().read_line(&mut String::new())?;
}
eprintln!("checking out appropriate branch");
@ -115,6 +116,7 @@ fn main() -> Result<(),Errors> {
#[cfg(debug_assertions)]
{
eprintln!("origin deleted");
std::io::stdin().read_line(&mut String::new())?;
}
let mut walk = repo.revwalk()?;
@ -126,18 +128,16 @@ fn main() -> Result<(),Errors> {
#[cfg(debug_assertions)]
{
eprintln!("oldest commit found");
std::io::stdin().read_line(&mut String::new())?;
}
let pwd = repo.path().parent().expect("very bad cloning into the root dir happening");
eprintln!("rebasing skeleton's commits down into single commit {:?}", pwd);
// I give up git2 documentation/api is just too bad for me to do this with it
let commit_arg:&str = &oldest_commit.id()
.as_bytes().iter()
.map(|byte|format!("{:02x}",byte))
.collect::<String>()[0..7];
handle_process(std::process::Command::new("git")
.current_dir(pwd)
.args(["reset", "--mixed" , commit_arg]))?;
.args(["reset", "--mixed" , oldest_commit.id().as_bytes().iter().map(|byte|format!("{:x}",byte)).collect::<String>().chars().take(7).collect::<String>().as_str()]))?;
handle_process(std::process::Command::new("git")
.current_dir(pwd)
@ -163,7 +163,6 @@ fn main() -> Result<(),Errors> {
prog_copy.print_help()?;
Ok(())
}
#[allow(dead_code)]
#[derive(Debug)]
enum CliError{Io(std::io::Error), NonZero}
impl From<std::io::Error> for CliError {