]
[[package]]
+name = "filetime"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "windows-sys",
+]
+
+[[package]]
name = "flate2"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
]
[[package]]
+name = "glob"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+
+[[package]]
name = "globset"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"chrono",
"clap",
+ "flate2",
"git2",
+ "glob",
"open",
"pulldown-cmark",
"rayon",
"serde",
"syntect",
+ "tar",
"tera",
"toml",
]
]
[[package]]
+name = "redox_syscall"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
name = "regex"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
]
[[package]]
+name = "tar"
+version = "0.4.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6"
+dependencies = [
+ "filetime",
+ "libc",
+ "xattr",
+]
+
+[[package]]
name = "tera"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
[[package]]
+name = "xattr"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
+dependencies = [
+ "libc",
+]
+
+[[package]]
name = "xml-rs"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
chrono = { version = "0.4.23", features=["clock"] }
clap = { version="4.0.32", features=["derive"] }
git2 = "0.15.0"
+glob = "0.3.1"
open = "3.2.0"
pulldown-cmark = { version = "0.9.2", optional = true }
rayon = "1.6.1"
# For SSH passphrase support:
#pinentry = "0.5.0"
#secrecy = "0.8.0"
+
+[dev-dependencies]
+flate2 = "1.0.25"
+tar = "0.4.38"
* You should have received a copy of the GNU General Public License
* along with Itsy-Gitsy. If not, see <http://www.gnu.org/licenses/>.
*/
+use glob::glob;
+use std::error::Error as StdError;
use std::path::Path;
use std::path::PathBuf;
use std::sync::atomic::AtomicUsize;
Settings,
Template,
Git,
+ Filesystem,
}
#[derive(Default)]
GitsyErrorKind::Git => write!(f, "gitsy error (git)")?,
GitsyErrorKind::Settings => write!(f, "gitsy error (settings)")?,
GitsyErrorKind::Template => write!(f, "gitsy error (template)")?,
- _ => write!(f, "gitsy error (unknown)")?,
+ GitsyErrorKind::Filesystem => write!(f, "gitsy error (filesystem)")?,
+ GitsyErrorKind::Unknown => write!(f, "gitsy error (unknown)")?,
}
- write!(f, ": {}", self.msg.as_deref().unwrap_or_default())
+ write!(f, ": {}", self.msg.as_deref().unwrap_or_default())?;
+ if let Some(src) = &self.source {
+ write!(f, " ({})", src)?;
+ }
+ Ok(())
}
}
impl std::fmt::Debug for GitsyError {
}
}
impl std::error::Error for GitsyError {
- fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
- self.source.as_deref()
+ fn source(&self) -> Option<&(dyn StdError + 'static)> {
+ self.source.as_ref().map(|c| &**c as &(dyn StdError + 'static))
}
}
impl From<git2::Error> for GitsyError {