mirror of
https://github.com/Pagwin-Fedora/ppi.git
synced 2025-07-17 14:05:42 +00:00
working on patching capabilities
This commit is contained in:
parent
5015de5c52
commit
5cd1c4c74b
4 changed files with 29 additions and 4 deletions
|
@ -3,3 +3,6 @@
|
|||
[subcommands.scripts]
|
||||
rs = "cargo-quick"
|
||||
js = "npm-quick"
|
||||
|
||||
[patching]
|
||||
prefix = "/home/pagwin/.local/share/patches/"
|
||||
|
|
10
patches/cabal-features.patch
Normal file
10
patches/cabal-features.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- testing-testing.cabal.old 2024-09-11 14:05:37.254611228 -0400
|
||||
+++ testing-testing.cabal 2024-09-11 14:07:06.045206895 -0400
|
||||
@@ -21,6 +21,7 @@
|
||||
main-is: Main.hs
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
+ default-extensions: ApplicativeDo DataKinds NamedFieldPuns DerivingVia LambdaCase TypeApplications DeriveGeneric OverloadedStrings OverloadedLists
|
||||
build-depends: base ^>=4.17.2.1
|
||||
hs-source-dirs: app
|
||||
default-language: Haskell2010
|
3
scripts/cabal-quick
Executable file
3
scripts/cabal-quick
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
cabal init "$@"
|
17
src/main.rs
17
src/main.rs
|
@ -12,13 +12,20 @@ use serde::{Serialize, Deserialize};
|
|||
#[derive(Serialize, Deserialize,Default)]
|
||||
struct Subcommands{
|
||||
//a hashmap of subcommands which can be created via cloning a skeleton repository
|
||||
skeletons:HashMap<String, (String, String)>,
|
||||
skeletons:Option<HashMap<String, (String, String)>>,
|
||||
// a hashmap of subcommands which can be created via running an external executable
|
||||
scripts: HashMap<String,PathBuf>
|
||||
scripts: Option<HashMap<String,PathBuf>>
|
||||
}
|
||||
#[derive(Serialize, Deserialize,Default)]
|
||||
struct Patching{
|
||||
// path to prefix to finding a patch (default is relative to pwd)
|
||||
prefix: Option<PathBuf>,
|
||||
cmd_patches: Option<HashMap<String, PathBuf>>
|
||||
}
|
||||
#[derive(Serialize, Deserialize,Default)]
|
||||
struct Config{
|
||||
subcommands: Subcommands
|
||||
subcommands: Subcommands,
|
||||
patching: Patching
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
@ -64,8 +71,10 @@ fn main() -> Result<(),Errors> {
|
|||
};
|
||||
buf
|
||||
}.as_str()).unwrap_or_default();
|
||||
let Config {subcommands:Subcommands { skeletons, scripts }, patching:_patching} = config;
|
||||
|
||||
let Config {subcommands:Subcommands { skeletons, scripts }} = config;
|
||||
let skeletons = skeletons.unwrap_or_default();
|
||||
let scripts = scripts.unwrap_or_default();
|
||||
|
||||
// Making sure the skeletons and scripts don't have overlap that will cause issue later
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue