-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 🚚 Reorganize package and repository actions into separate m…
…odules
- Loading branch information
1 parent
6c7d9e9
commit b46d9f7
Showing
17 changed files
with
259 additions
and
83 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display("Could not list:\n {source}"))] | ||
CouldNotList { source: list::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not search:\n {source}"))] | ||
CouldNotSearch { source: search::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not install:\n {source}"))] | ||
CouldNotInstall { source: install::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not update:\n {source}"))] | ||
CouldNotUpdate { source: update::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not uninstall:\n {source}"))] | ||
CouldNotUninstall { source: uninstall::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not downgrade:\n {source}"))] | ||
CouldNotDowngrade { source: downgrade::Error }, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use std::path::PathBuf; | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS | ||
|
||
// region: MODULES | ||
|
||
pub mod downgrade; | ||
pub mod install; | ||
pub mod list; | ||
pub mod search; | ||
pub mod uninstall; | ||
pub mod update; | ||
|
||
// endregion: MODULES | ||
|
||
// region: RE-EXPORTS | ||
|
||
#[allow(unused_imports)] | ||
pub use downgrade::*; | ||
#[allow(unused_imports)] | ||
pub use install::*; | ||
#[allow(unused_imports)] | ||
pub use list::*; | ||
#[allow(unused_imports)] | ||
pub use search::*; | ||
#[allow(unused_imports)] | ||
pub use uninstall::*; | ||
#[allow(unused_imports)] | ||
pub use update::*; | ||
|
||
// endregion: RE-EXPORTS | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display(""))] | ||
Dummy {}, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display(""))] | ||
Dummy {}, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display("Could not list:\n {source}"))] | ||
CouldNotList { source: list::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not search:\n {source}"))] | ||
CouldNotSearch { source: search::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not install:\n {source}"))] | ||
CouldNotInstall { source: install::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not update:\n {source}"))] | ||
CouldNotUpdate { source: update::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not uninstall:\n {source}"))] | ||
CouldNotUninstall { source: uninstall::Error }, | ||
|
||
#[non_exhaustive] | ||
#[snafu(display("Could not downgrade:\n {source}"))] | ||
CouldNotDowngrade { source: downgrade::Error }, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use std::path::PathBuf; | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS | ||
|
||
// region: MODULES | ||
|
||
pub mod downgrade; | ||
pub mod install; | ||
pub mod list; | ||
pub mod search; | ||
pub mod uninstall; | ||
pub mod update; | ||
|
||
// endregion: MODULES | ||
|
||
// region: RE-EXPORTS | ||
|
||
#[allow(unused_imports)] | ||
pub use downgrade::*; | ||
#[allow(unused_imports)] | ||
pub use install::*; | ||
#[allow(unused_imports)] | ||
pub use list::*; | ||
#[allow(unused_imports)] | ||
pub use search::*; | ||
#[allow(unused_imports)] | ||
pub use uninstall::*; | ||
#[allow(unused_imports)] | ||
pub use update::*; | ||
|
||
// endregion: RE-EXPORTS | ||
#[macro_export] | ||
macro_rules! home { | ||
() => { | ||
match home::home_dir() { | ||
Some(path) => path, | ||
None => panic!("Impossible to get your home dir!"), | ||
} | ||
}; | ||
} | ||
|
||
#[inline] | ||
pub fn ensure_path(path: Option<&PathBuf>) { | ||
if path.is_none() { | ||
let mut file = home!(); | ||
file.push(".paxy"); | ||
if !file.is_dir() { | ||
::std::fs::create_dir_all(file).expect("Inufficient permissions"); | ||
} | ||
} else { | ||
if !path | ||
.unwrap() | ||
.is_dir() | ||
{ | ||
::std::fs::create_dir_all( | ||
path.unwrap() | ||
.clone(), | ||
) | ||
.expect("Inufficient permissions"); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display(""))] | ||
Dummy {}, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display(""))] | ||
Dummy {}, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[non_exhaustive] | ||
#[snafu(display(""))] | ||
Dummy {}, | ||
} | ||
|
||
// region: IMPORTS | ||
|
||
use snafu::Snafu; | ||
|
||
// endregion: IMPORTS |
This file was deleted.
Oops, something went wrong.
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,5 +1,3 @@ | ||
pub trait InitI18n {} | ||
|
||
#[derive(Debug, Snafu)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
|