diff --git a/Cargo.lock b/Cargo.lock index 1e32720..77a474e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,6 +49,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.19" @@ -82,13 +93,22 @@ dependencies = [ "ansitok", ] +[[package]] +name = "ansi-str" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b1ed1c166829a0ccb5d79caa0f75cb4abd4adb2ce2c096755b7ad5ffdb0990" +dependencies = [ + "ansitok", +] + [[package]] name = "ansitok" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83" dependencies = [ - "nom 7.1.1", + "nom", "vte", ] @@ -110,7 +130,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -142,6 +162,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "bindgen" version = "0.59.2" @@ -254,29 +280,35 @@ checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" [[package]] name = "calamine" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86ca78da4bdce5ac0f0bdbc0218ad14232f1e668376e044233f64c527cf5abb" +checksum = "6381d1037ee9b8a6c8eb97936add0331a1aabd148d5b6f35f1cda6e5dec44f40" dependencies = [ "byteorder", "codepage", "encoding_rs", "log", - "quick-xml 0.19.0", + "quick-xml 0.25.0", "serde", "zip", ] [[package]] name = "cargo_toml" -version = "0.13.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" +checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml", + "toml 0.7.2", ] +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + [[package]] name = "cc" version = "1.0.76" @@ -289,7 +321,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.1", + "nom", ] [[package]] @@ -332,9 +364,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.6.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c39203181991a7dd4343b8005bd804e7a9a37afb8ac070e43771e8c820bbde" +checksum = "fa48fa079165080f11d7753fd0bc175b7d391f276b965fe4b55bfad67856e463" dependencies = [ "chrono", "chrono-tz-build", @@ -343,9 +375,9 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.0.3" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f509c3a87b33437b05e2458750a0700e5bdd6956176773e6c7d6dd15a283a0c" +checksum = "d9998fb9f7e9b2111641485bf8beb32f92945f97f92a3d061f744cfef335f751" dependencies = [ "parse-zoneinfo", "phf 0.11.1", @@ -365,14 +397,14 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.24" +version = "4.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60494cedb60cb47462c0ff7be53de32c0e42a6fc2c772184554fa12bd9489c03" +checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", + "is-terminal", "once_cell", "strsim", "termcolor", @@ -380,9 +412,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", @@ -574,6 +606,22 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags", + "crossterm_winapi", + "libc", + "mio 0.8.5", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi 0.3.9", +] + [[package]] name = "crossterm_winapi" version = "0.9.0" @@ -671,14 +719,12 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb" +checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" dependencies = [ "console", - "lazy_static", - "tempfile", - "zeroize", + "shell-words", ] [[package]] @@ -738,10 +784,11 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "embed-nu" -version = "0.3.5" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f800d9b27f8c59e9f82a59abe65dfc5f795110cf91c5c49227d8c985bd36f9" +checksum = "68aa4f2526c288988415faed8bf24ab39ffe6fc4a8c919988bb5cca06d732533" dependencies = [ + "miette", "nu-command", "nu-engine", "nu-parser", @@ -829,9 +876,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fancy-regex" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", @@ -853,7 +900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb21c69b9fea5e15dbc1049e4b77145dd0ba1c84019c488102de0dc4ea4b0a27" dependencies = [ "cfg-if 1.0.0", - "rustix 0.36.1", + "rustix 0.36.8", "windows-sys 0.42.0", ] @@ -1087,7 +1134,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", ] [[package]] @@ -1096,7 +1152,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1114,6 +1170,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hex" version = "0.4.3" @@ -1259,10 +1321,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] +[[package]] +name = "indicatif" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width", +] + [[package]] name = "inotify" version = "0.7.1" @@ -1294,9 +1368,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.2.3" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84344c6e0b90a9e2b6f3f9abe5cc74402684e348df7b32adca28747e0cef091a" +checksum = "16fe3b35d64bd1f72917f06425e7573a2f63f74f42c8f56e53ea6826dde3a2b5" dependencies = [ "ctor", "ghost", @@ -1343,6 +1417,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "is-terminal" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes 1.0.1", + "rustix 0.36.8", + "windows-sys 0.45.0", +] + [[package]] name = "is_ci" version = "1.1.1" @@ -1402,9 +1488,9 @@ dependencies = [ [[package]] name = "json_to_table" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "408f09e42613f7a9902ecf2f30bcd053cf9f5668d0b1493ae1669070338d661b" +checksum = "a0be33515faeb3773f550c80fd7a889148164e58f7e3cf36467718c8ce71ee55" dependencies = [ "serde_json", "tabled", @@ -1444,9 +1530,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libloading" @@ -1540,13 +1626,22 @@ dependencies = [ "libc", ] +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "lscolors" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "074bff749d092e2e818fe954952102f88e21f67fc69f4d350621aab15a1810f1" dependencies = [ - "crossterm", + "crossterm 0.24.0", ] [[package]] @@ -1582,23 +1677,14 @@ dependencies = [ "autocfg", ] -[[package]] -name = "meval" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79496a5651c8d57cd033c5add8ca7ee4e3d5f7587a4777484640d9cb60392d9" -dependencies = [ - "fnv", - "nom 1.2.4", -] - [[package]] name = "miette" -version = "5.4.1" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" +checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" dependencies = [ "atty", + "backtrace", "miette-derive", "once_cell", "owo-colors", @@ -1613,9 +1699,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.4.1" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" +checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" dependencies = [ "proc-macro2", "quote", @@ -1628,6 +1714,16 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1748,12 +1844,6 @@ dependencies = [ "serde", ] -[[package]] -name = "nom" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" - [[package]] name = "nom" version = "7.1.1" @@ -1774,7 +1864,16 @@ dependencies = [ "indent_write", "joinery", "memchr", - "nom 7.1.1", + "nom", +] + +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", ] [[package]] @@ -1816,33 +1915,36 @@ dependencies = [ [[package]] name = "nu-color-config" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd2bf02ba0fb7ef0f78e95458b20a005397605d53e05622c8c34b3cc7acbb6b" +checksum = "159c4e235f559ece91ed2d860c8157e92cfe672a0db06281633bad9247236546" dependencies = [ "nu-ansi-term", + "nu-engine", "nu-json", "nu-protocol", - "nu-table", + "nu-utils", "serde", + "tabled", ] [[package]] name = "nu-command" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb50c55f1d3ae8c9850f6eac570df16aac6cd1b7a8e158fe2ce7e46449ce2ee2" +checksum = "7db026290882489a0aa5348678a4a02cac8bfc04775ba91908ede6f2685b9f21" dependencies = [ "Inflector", "alphanumeric-sort", - "base64", + "atty", + "base64 0.21.0", "byteorder", "bytesize", "calamine", "chrono", "chrono-humanize", "chrono-tz", - "crossterm", + "crossterm 0.24.0", "csv", "dialoguer", "digest", @@ -1856,19 +1958,20 @@ dependencies = [ "htmlescape", "ical", "indexmap", + "indicatif", "is-root", "itertools", - "lazy_static", "libc", "log", "lscolors", "md-5", - "meval", "mime", + "mime_guess", "notify", "nu-ansi-term", "nu-color-config", "nu-engine", + "nu-explore", "nu-glob", "nu-json", "nu-parser", @@ -1881,12 +1984,16 @@ dependencies = [ "nu-utils", "num-format", "num-traits", + "once_cell", + "open", "pathdiff", + "percent-encoding", "powierza-coefficient", - "quick-xml 0.23.1", + "quick-xml 0.27.1", "rand 0.8.5", "rayon", "reedline", + "regex", "reqwest", "roxmltree", "rust-embed", @@ -1901,12 +2008,12 @@ dependencies = [ "terminal_size 0.2.2", "thiserror", "titlecase", - "toml", + "toml 0.5.9", "umask", "unicode-segmentation", "url", "users 0.11.0", - "uuid 1.2.1", + "uuid 1.3.0", "wax", "windows", "winreg", @@ -1914,32 +2021,53 @@ dependencies = [ [[package]] name = "nu-engine" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06f5dbec60388a9fc1e8ea7df5fa46804e656db42e1e420d6e3885bf383abd2" +checksum = "2a1cf4bca79b201e0be4584894f8915a5e3b672e80f48a19a3b44153ead0e8ff" dependencies = [ "chrono", "nu-glob", "nu-path", "nu-protocol", "nu-utils", + "serde", "sysinfo", ] +[[package]] +name = "nu-explore" +version = "0.75.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb98e4819c12e74fcf962e086955cea73278d5a6c44f937c60fd3e39622e88bc" +dependencies = [ + "ansi-str 0.7.2", + "crossterm 0.24.0", + "lscolors", + "nu-ansi-term", + "nu-color-config", + "nu-engine", + "nu-json", + "nu-parser", + "nu-protocol", + "nu-table", + "nu-utils", + "strip-ansi-escapes", + "terminal_size 0.2.2", + "tui", +] + [[package]] name = "nu-glob" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e1d0c9dad7a0238d4d4a56062bcd874bb60d9fd927d4b2683d152c678fc0ede" +checksum = "2db2124bb05eccdb7f2ae20e31177ef7869650cd60af79f7d540f4ccd722c928" [[package]] name = "nu-json" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fde5b1cd8c08712ed3349633a4ae59c46c732882c8180dd670d7bcb046314ae" +checksum = "b3b41550bd4954b2f378950cbd7b48c077dc55b04e115ba9ca86ce48e19bf223" dependencies = [ - "fancy-regex", - "lazy_static", "linked-hash-map", "num-traits", "serde", @@ -1947,9 +2075,9 @@ dependencies = [ [[package]] name = "nu-parser" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152fe24f17c0dc12831a36e7e4477cb5efc1f2ed41bdc1379bea7526f1d1b94c" +checksum = "ae6ba64902776f9134d3d0ba78d7f6d3bfd0a7696199c96a1c0c90d91c2400b7" dependencies = [ "bytesize", "chrono", @@ -1965,9 +2093,9 @@ dependencies = [ [[package]] name = "nu-path" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20390308cea78aafb8c31282359cc613f24f1089cd1603457c9c5bdffbe9e3fd" +checksum = "b4d6915bca27ebc7dce740160f1ad5da8a1f428ae3f734ffaa8e3512d22a7a6b" dependencies = [ "dirs-next", "omnipath", @@ -1976,30 +2104,33 @@ dependencies = [ [[package]] name = "nu-pretty-hex" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c178b7beefbc720fc56f380b5c503a5bf81cf8272cf03a901bf6202130d1a208" +checksum = "1521af52990f7da240dac11d6e0678f8a969cf6c899a2f18eef964ba35a885a7" dependencies = [ "nu-ansi-term", ] [[package]] name = "nu-protocol" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7beefa3ccb5bc29487b6025b0fa3534b4a784de5aef46de558880a7b3b47a1bc" +checksum = "df02c3ce5a8ed42c9cb154b3a4b65a48ec60ac64f95196e41aab152fd3020281" dependencies = [ "byte-unit", "chrono", "chrono-humanize", "fancy-regex", "indexmap", + "lru", "miette", "nu-json", "nu-utils", "num-format", "serde", "serde_json", + "strum", + "strum_macros", "sys-locale", "thiserror", "typetag", @@ -2007,9 +2138,9 @@ dependencies = [ [[package]] name = "nu-system" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "274feed3d2a1f78eef313fb45e1d376d4332801927833a459d93091dd2c82aa2" +checksum = "3a600113cf1e9174693653e3b167a3cc5f7225da5ece1ac460b6929988f0b8aa" dependencies = [ "atty", "chrono", @@ -2027,13 +2158,15 @@ dependencies = [ [[package]] name = "nu-table" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac51a65a6c8f6e90aaf336651c5cbfdb680ec891dbdaaec4bbc6706d1b7f0659" +checksum = "a082b6c426214d4b132120d322d4016bb5d630f0183f4e01583784f7d4937a8b" dependencies = [ "atty", "json_to_table", "nu-ansi-term", + "nu-color-config", + "nu-engine", "nu-protocol", "nu-utils", "serde_json", @@ -2042,9 +2175,9 @@ dependencies = [ [[package]] name = "nu-term-grid" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e174acda1ade8ba9965b8f44946116b6b00801fb68df435d9647973965083db" +checksum = "314365e22c4255c9e35a60dcd481b429a68b427335798082811065d66818442f" dependencies = [ "nu-utils", "unicode-width", @@ -2052,11 +2185,12 @@ dependencies = [ [[package]] name = "nu-utils" -version = "0.71.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5691df5e1a455df9ddc392da10328a26dd0462c9df5ffd99269fc443b0fe275" +checksum = "955496c3bd7d5915e089e013f49065cffaeff7cb7a38494732abce69e157d868" dependencies = [ "crossterm_winapi", + "log", "lscolors", "num-format", "strip-ansi-escapes", @@ -2098,7 +2232,7 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -2111,6 +2245,12 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" version = "0.29.0" @@ -2128,9 +2268,19 @@ checksum = "e7461858c5ac9bde3fcdeedc17f58ed0469ec74f2d737b6369fc31c0b0ef576c" [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "open" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" +dependencies = [ + "pathdiff", + "windows-sys 0.42.0", +] [[package]] name = "openssl" @@ -2201,7 +2351,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1526bb6aa9f10ec339fb10360f22c57edf81d5678d0278e93bc12a47ffbe4b01" dependencies = [ - "ansi-str", + "ansi-str 0.5.0", "ansitok", "bytecount", "fnv", @@ -2242,9 +2392,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pathdiff" @@ -2338,7 +2488,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" dependencies = [ "siphasher", - "uncased", ] [[package]] @@ -2365,14 +2514,20 @@ version = "0.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a63d338dec139f56dacc692ca63ad35a6be6a797442479b55acd611d79e906" dependencies = [ - "nom 7.1.1", + "nom", ] +[[package]] +name = "portable-atomic" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" + [[package]] name = "powierza-coefficient" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e2c03bca73af2a7a2c021a6b3b4991658b760b2e0a84e3e425a9c9eda2ba7f" +checksum = "04123079750026568dff0e68efe1ca676f6686023f3bf7686b87dab661c0375b" [[package]] name = "ppv-lite86" @@ -2461,9 +2616,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.19.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d72d5477478f85bd00b6521780dfba1ec6cdaadcf90b8b181c36d7de561f9b" +checksum = "58e21a144a0ffb5fad7b464babcdab934a325ad69b7c0373bcfef5cbd9799ca9" dependencies = [ "encoding_rs", "memchr", @@ -2471,9 +2626,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.23.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +checksum = "ffc053f057dd768a56f62cd7e434c42c831d296968997e9ac1f76ea7c2d14c41" dependencies = [ "memchr", ] @@ -2570,21 +2725,19 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -2614,12 +2767,12 @@ dependencies = [ [[package]] name = "reedline" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75d91d2a38dbdaf0c748a96055c14aa4746be9add5f4aea4b1460e6e6492f770" +checksum = "da60f4ca4517626e4621dba4fb252069572d5bfaf41efb96dfa5c93f39f2e978" dependencies = [ "chrono", - "crossterm", + "crossterm 0.24.0", "fd-lock", "itertools", "nu-ansi-term", @@ -2636,9 +2789,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -2672,7 +2825,7 @@ version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -2711,9 +2864,9 @@ checksum = "194d8e591e405d1eecf28819740abed6d719d1a2db87fc0bcdedee9a26d55560" [[package]] name = "roxmltree" -version = "0.14.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921904a62e410e37e215c40381b7117f830d9d89ba60ab5236170541dd25646b" +checksum = "461c9b944cd1481b793aeef26d1008b5d1fdeb00e01296cb4ff08aed511c7383" dependencies = [ "xmlparser", ] @@ -2804,16 +2957,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.1" +version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812a2ec2043c4d6bc6482f5be2ab8244613cac2493d128d36c0759e52a626ab3" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", "errno", "io-lifetimes 1.0.1", "libc", "linux-raw-sys 0.1.2", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -2905,18 +3058,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -2936,15 +3089,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ "itoa 1.0.4", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2983,9 +3145,9 @@ dependencies = [ [[package]] name = "shadow-rs" -version = "0.16.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0ea0c68418544f725eba5401a5b965a2263254c92458d04aeae74e9d88ff4e" +checksum = "0942b9991e2cfab3d5059e508d517c66bc460b302a2a8187a90d0aae4f08531d" dependencies = [ "const_format", "is_debug", @@ -3001,6 +3163,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.1.0" @@ -3149,9 +3317,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -3173,9 +3341,9 @@ dependencies = [ [[package]] name = "sys-mount" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793d38aa916d55e979587ea7cf551106f5f091e548a91e89ee4f0698bc9cf289" +checksum = "d8b080a2fff4d267282506b4d5f2efe0dfa732fb2a5715f30662eed1c4f13390" dependencies = [ "bitflags", "libc", @@ -3187,9 +3355,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.26.7" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c375d5fd899e32847b8566e10598d6e9f1d9b55ec6de3cdf9e7da4bdc51371bc" +checksum = "975fe381e0ecba475d4acff52466906d95b153a40324956552e027b2a9eaa89e" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys", @@ -3206,7 +3374,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56c3ee73732ffceaea7b8f6b719ce3bb17f253fa27461ffeaf568ebd0cdb4b85" dependencies = [ - "ansi-str", + "ansi-str 0.5.0", "papergrid", "tabled_derive", "unicode-width", @@ -3281,18 +3449,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -3376,9 +3544,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.21.2" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", "bytes", @@ -3391,7 +3559,7 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] @@ -3438,6 +3606,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" +dependencies = [ + "indexmap", + "nom8", + "serde", + "serde_spanned", + "toml_datetime", +] + [[package]] name = "tourmaline" version = "0.1.0" @@ -3449,6 +3651,7 @@ dependencies = [ "embed-nu", "lazy_static", "libc", + "miette", "paste", "rusty-value", "serde", @@ -3456,7 +3659,7 @@ dependencies = [ "sys-mount", "thiserror", "tokio", - "toml", + "toml 0.7.2", "tracing", "tracing-subscriber", "valico", @@ -3542,6 +3745,19 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "tui" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1" +dependencies = [ + "bitflags", + "cassowary", + "crossterm 0.25.0", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "typenum" version = "1.15.0" @@ -3550,9 +3766,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "typetag" -version = "0.1.8" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4080564c5b2241b5bff53ab610082234e0c57b0417f4bd10596f183001505b8a" +checksum = "8eecd98403ae5ea2813689125cf5b3f99c40b8abed46c0a8945c81eadb673b31" dependencies = [ "erased-serde", "inventory", @@ -3563,9 +3779,9 @@ dependencies = [ [[package]] name = "typetag-impl" -version = "0.1.8" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e60147782cc30833c05fba3bab1d9b5771b2685a2557672ac96fa5d154099c0e" +checksum = "8f9568611f0de5e83e0993b85c54679cd0afd659adcfcb0233f16280b980492e" dependencies = [ "proc-macro2", "quote", @@ -3579,10 +3795,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46b0c16eadfb312c7acd6970fc97d1f3152eb536714a2ff72ca09a92cae6fa67" [[package]] -name = "uncased" -version = "0.9.7" +name = "unicase" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ "version_check", ] @@ -3605,7 +3821,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", "regex", ] @@ -3705,9 +3921,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom 0.2.8", ] @@ -3719,7 +3935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "647856408e327686b6640397d19f60fac3e64c3bfaa6afc409da63ef7da45edb" dependencies = [ "addr", - "base64", + "base64 0.13.1", "chrono", "json-pointer", "jsonway", @@ -3893,7 +4109,7 @@ dependencies = [ "bstr", "const_format", "itertools", - "nom 7.1.1", + "nom", "nom-supreme", "pori", "regex", @@ -3957,17 +4173,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.42.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0286ba339aa753e70765d521bb0242cc48e1194562bfa2a2ad7ac8a6de28f5d5" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows-targets", ] [[package]] @@ -3990,19 +4200,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" @@ -4012,9 +4246,9 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" @@ -4024,9 +4258,9 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" @@ -4036,9 +4270,9 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" @@ -4048,15 +4282,15 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" @@ -4066,9 +4300,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" @@ -4095,20 +4329,14 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" - [[package]] name = "zip" -version = "0.5.13" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" dependencies = [ "byteorder", "crc32fast", + "crossbeam-utils", "flate2", - "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index dd48756..0bd44f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,24 +16,25 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.0.24", features = ["derive"] } +clap = { version = "4.1.6", features = ["derive"] } color-eyre = "0.6.2" dotenv = "0.15.0" -embed-nu = "0.3.5" +embed-nu = "0.5.1" lazy_static = "1.4.0" -libc = "0.2.137" -paste = "1.0.9" +libc = "0.2.139" +miette = { version = "5.5.0", features = ["fancy"] } +paste = "1.0.11" rusty-value = { version = "0.6.0", features = ["derive", "json"] } -serde = { version = "1.0.147", features = ["derive"] } -serde_json = "1.0.87" -sys-mount = "2.0.1" -thiserror = "1.0.37" -tokio = { version = "1.21.2", features = ["rt", "io-std", "io-util", "process", "time", "macros", "tracing", "fs"] } -toml = "0.5.9" +serde = { version = "1.0.152", features = ["derive"] } +serde_json = "1.0.93" +sys-mount = "2.0.2" +thiserror = "1.0.38" +tokio = { version = "1.25.0", features = ["rt", "io-std", "io-util", "process", "time", "macros", "tracing", "fs"] } +toml = "0.7.2" tracing = "0.1.37" tracing-subscriber = "0.3.16" valico = "3.6.1" [build-dependencies] -cargo_toml = "0.13.0" -serde = { version = "1.0.147", features = ["derive"] } +cargo_toml = "0.15.2" +serde = { version = "1.0.152", features = ["derive"] } diff --git a/src/distro/distro_config.rs b/src/distro/distro_config.rs index 43fcb6e..4927190 100644 --- a/src/distro/distro_config.rs +++ b/src/distro/distro_config.rs @@ -3,7 +3,8 @@ use std::{collections::HashMap, path::PathBuf}; use serde::Deserialize; use tokio::fs; -use crate::{error::DistroConfigError, utils::CFG_PATH}; +use crate::utils::CFG_PATH; +use miette::{self, Context, IntoDiagnostic, Result}; /// The config file of a distro that defines /// how that distro should be installed @@ -61,10 +62,13 @@ fn default_order() -> usize { impl DistroConfig { #[tracing::instrument(level = "trace", skip_all)] - pub async fn load() -> Result { + pub async fn load() -> Result { let path = CFG_PATH.join("distro.toml"); - let contents = fs::read_to_string(path).await?; - let cfg = toml::from_str::(&contents)?; + let contents = fs::read_to_string(path) + .await + .into_diagnostic() + .context("reading config file")?; + let cfg = toml::from_str::(&contents).into_diagnostic()?; Ok(cfg) } diff --git a/src/distro/os_config/loader.rs b/src/distro/os_config/loader.rs index 8c3274a..13e0398 100644 --- a/src/distro/os_config/loader.rs +++ b/src/distro/os_config/loader.rs @@ -5,9 +5,10 @@ use valico::json_schema::Scope; use crate::{ distro::distro_config::DistroConfig, - error::{AppResult, OSConfigError, SchemaError}, + error::{OSConfigError, SchemaError}, utils::CFG_PATH, }; +use miette::{IntoDiagnostic, Result}; use super::OSConfig; @@ -26,7 +27,7 @@ impl<'a> OSConfigLoader<'a> { } #[tracing::instrument(level = "trace", skip_all)] - pub async fn load(&self) -> AppResult { + pub async fn load(&self) -> Result { let schema = self.load_extension_schema().await?; let os_config = OSConfig::load(&self.cfg_path).await?; Self::validate_config(schema, &os_config)?; @@ -35,7 +36,7 @@ impl<'a> OSConfigLoader<'a> { } #[tracing::instrument(level = "trace", skip_all)] - async fn load_extension_schema(&self) -> Result { + async fn load_extension_schema(&self) -> Result { let schema_path = self .distro_cfg .config @@ -43,14 +44,14 @@ impl<'a> OSConfigLoader<'a> { .as_ref() .map(|p| CFG_PATH.join(p)) .unwrap_or_else(|| CFG_PATH.join("config.schema.json")); - let contents = fs::read_to_string(schema_path).await?; - let schema = serde_json::from_str(&contents)?; + let contents = fs::read_to_string(schema_path).await.into_diagnostic()?; + let schema = serde_json::from_str(&contents).into_diagnostic()?; Ok(schema) } #[tracing::instrument(level = "trace", skip_all)] - fn validate_config(schema: serde_json::Value, config: &OSConfig) -> AppResult<()> { + fn validate_config(schema: serde_json::Value, config: &OSConfig) -> Result<()> { let mut scope = Scope::new(); let schema = scope .compile_and_return(schema, true) diff --git a/src/distro/os_config/mod.rs b/src/distro/os_config/mod.rs index d2fbf9d..c963c11 100644 --- a/src/distro/os_config/mod.rs +++ b/src/distro/os_config/mod.rs @@ -10,10 +10,11 @@ use embed_nu::{ }, RustyIntoValue, }; +use miette::{Context, IntoDiagnostic, Result}; use serde::Deserialize; use tokio::fs; -use crate::error::{AppResult, OSConfigError}; +use crate::error::OSConfigError; /// Represents the full configuration of the OS including extensions defined /// by the distro @@ -26,7 +27,7 @@ pub struct OSConfig { } impl OSConfig { - pub fn get_nu_value>(&self, key: K) -> AppResult { + pub fn get_nu_value>(&self, key: K) -> Result { let value = self.clone().into_rusty_value(); let mut fields = if let Value::Struct(Struct { fields, .. }) = value { if let Fields::Named(named) = fields { @@ -114,9 +115,14 @@ fn json_to_rusty_value(val: serde_json::Value) -> embed_nu::rusty_value::Value { } impl OSConfig { - pub(crate) async fn load(path: &Path) -> Result { - let contents = fs::read_to_string(path).await?; - let cfg = serde_json::from_str::(&contents)?; + pub(crate) async fn load(path: &Path) -> Result { + let contents = fs::read_to_string(path) + .await + .into_diagnostic() + .context("reading config contents")?; + let cfg = serde_json::from_str::(&contents) + .into_diagnostic() + .context("parsing_json")?; Ok(cfg) } diff --git a/src/error.rs b/src/error.rs index e4dd2d8..c461b70 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,6 @@ use std::{io, path::PathBuf}; +use miette::Diagnostic; use thiserror::Error; pub type AppResult = std::result::Result; @@ -31,18 +32,18 @@ pub enum AppError { Chroot(#[from] ChrootError), } -#[derive(Error, Debug)] +#[derive(Error, Debug, Diagnostic)] pub enum ScriptError { #[error("IO Error when trying to read script file: {0}")] + #[diagnostic(code(trm::script::io_error))] Io(#[from] io::Error), #[error("Could not find the script file at {0}")] + #[diagnostic(code(trm::script::not_found))] ScriptNotFound(PathBuf), - #[error("Nu error when executing script: {0}")] - NuError(#[from] embed_nu::Error), - #[error("Could not find the main method in the script file: {0}")] + #[diagnostic(code(trm::script::no_main))] MissingMain(PathBuf), } @@ -55,59 +56,75 @@ pub enum DistroConfigError { InvalidToml(#[from] toml::de::Error), } -#[derive(Error, Debug)] +#[derive(Error, Debug, Diagnostic)] pub enum SchemaError { + #[diagnostic(code(trm::schema::io))] #[error("IO Error when trying to read json-schema file: {0}")] Io(#[from] io::Error), #[error("Encountered invalid JSON when parsing json-schema: {0}")] + #[diagnostic(code(trm::schema::invalid_json))] InvalidJson(#[from] serde_json::Error), #[error("Failed to parse the json-schema: {0}")] + #[diagnostic(code(trm::schema::invalid_schema))] ParseSchema(#[from] valico::json_schema::SchemaError), } -#[derive(Error, Debug)] +#[derive(Error, Debug, Diagnostic)] pub enum OSConfigError { + #[diagnostic(code(trm::os_config::io))] #[error("IO Error when trying to read OSConfig file: {0}")] Io(#[from] io::Error), + #[diagnostic(code(trm::os_config::invalid_json))] #[error("Encountered invalid JSON when parsing OSConfig: {0}")] InvalidJson(#[from] serde_json::Error), + #[diagnostic(code(trm::os_config::invalid))] #[error("The os config is invalid:\n{0}")] Validation(String), + #[diagnostic(code(trm::os_config::missing_key))] #[error("Missing config key {0}")] MissingConfigKey(String), } -#[derive(Error, Debug)] +#[derive(Error, Debug, Diagnostic)] pub enum ChrootError { + #[diagnostic(code(trm::chroot::not_found))] #[error("Could not find chroot directory {0}")] NotFound(PathBuf), #[error("Failed to unshare FS resources with parent: {0}")] + #[diagnostic(code(trm::chroot::unshare))] Unshare(io::Error), #[error("Failed to create chroot dir: {0}")] + #[diagnostic(code(trm::chroot::create))] CreateChroot(io::Error), #[error("Failed to chroot: {0}")] + #[diagnostic(code(trm::chroot::enter))] Chroot(io::Error), #[error("Failed to mount directory {0} in chroot: {1}")] + #[diagnostic(code(trm::chroot::mount))] Mount(PathBuf, io::Error), - #[error("Failed to create symlink {0} in chroot: {1}")] + #[error("Failed to create symlink to {0} in chroot: {1}")] + #[diagnostic(code(trm::chroot::symlink))] Link(PathBuf, io::Error), #[error("Failed to remove symlink in chroot: {0}")] + #[diagnostic(code(trm::chroot::unlink))] Unlink(io::Error), #[error("Failed to copy file {0} to chroot: {1}")] + #[diagnostic(code(trm::chroot::copy_file))] Copy(PathBuf, io::Error), #[error("Failed to change process working directory: {0}")] + #[diagnostic(code(trm::chroot::chdir))] ChDir(io::Error), } diff --git a/src/lib.rs b/src/lib.rs index 95fe6cd..8d01629 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,15 +4,15 @@ pub(crate) mod utils; use std::path::PathBuf; use distro::{distro_config::DistroConfig, loader::OSConfigLoader}; -use error::AppResult; use task::task_executor::TaskExecutor; pub use utils::generate_script_files; pub mod distro; pub mod task; +use miette::Result; /// Creates a new executor with the given os config for the current distro #[tracing::instrument(level = "trace")] -pub async fn create_executor(os_cfg_path: PathBuf) -> AppResult { +pub async fn create_executor(os_cfg_path: PathBuf) -> Result { let distro_config = DistroConfig::load().await?; let os_config = OSConfigLoader::new(os_cfg_path, &distro_config) .load() diff --git a/src/main.rs b/src/main.rs index 68730dd..26dbfde 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,17 @@ use args::{Args, Command, CreateEmptyConfigArgs, GenerateScriptsArgs, InstallFromConfigArgs}; use clap::Parser; +use miette::{Context, IntoDiagnostic, Result}; use rusty_value::into_json::{EnumRepr, IntoJson, IntoJsonOptions}; use tokio::fs; -use tourmaline::{distro::OSConfig, error::AppResult, generate_script_files}; +use tourmaline::{distro::OSConfig, generate_script_files}; mod args; #[tokio::main(flavor = "current_thread")] -async fn main() -> color_eyre::Result<()> { +async fn main() -> miette::Result<()> { + miette::set_panic_hook(); color_eyre::install().unwrap(); - dotenv::dotenv().unwrap(); + let _ = dotenv::dotenv(); let args = Args::parse(); match args.command { @@ -22,7 +24,7 @@ async fn main() -> color_eyre::Result<()> { } /// Installs the distro from a given configuration file -async fn install_from_config(args: InstallFromConfigArgs) -> AppResult<()> { +async fn install_from_config(args: InstallFromConfigArgs) -> Result<()> { tourmaline::create_executor(args.path) .await? .with_base_tasks() @@ -31,16 +33,21 @@ async fn install_from_config(args: InstallFromConfigArgs) -> AppResult<()> { .await } -async fn generate_scripts(args: GenerateScriptsArgs) -> AppResult<()> { +async fn generate_scripts(args: GenerateScriptsArgs) -> Result<()> { generate_script_files(args.path).await } -async fn generate_empty_config(args: CreateEmptyConfigArgs) -> AppResult<()> { +async fn generate_empty_config(args: CreateEmptyConfigArgs) -> Result<()> { let config = OSConfig::empty().into_json_with_options(&IntoJsonOptions { enum_repr: EnumRepr::Untagged, }); - let config_string = serde_json::to_string_pretty(&config)?; - fs::write(args.path, config_string).await?; + let config_string = serde_json::to_string_pretty(&config) + .into_diagnostic() + .context("serializing default config")?; + fs::write(args.path, config_string) + .await + .into_diagnostic() + .context("writing empty config")?; Ok(()) } diff --git a/src/task/base_task.rs b/src/task/base_task.rs index ef78d98..018e666 100644 --- a/src/task/base_task.rs +++ b/src/task/base_task.rs @@ -1,10 +1,11 @@ use std::path::PathBuf; -use crate::{distro::OSConfig, error::AppResult}; +use crate::distro::OSConfig; use super::{exec_builder::ExecBuilder, TaskTrait}; use embed_nu::IntoValue; use lazy_static::lazy_static; +use miette::Result; #[derive(Clone, Debug)] pub enum BaseTask { @@ -75,7 +76,7 @@ impl BaseTask { impl TaskTrait for BaseTask { #[tracing::instrument(level = "trace", skip_all)] - fn up(&self, config: &OSConfig) -> AppResult> { + fn up(&self, config: &OSConfig) -> Result> { let key_data = self.key_data(); let script = PathBuf::from(key_data.task_name).join("up.nu"); @@ -90,7 +91,7 @@ impl TaskTrait for BaseTask { } #[tracing::instrument(level = "trace", skip_all)] - fn down(&self, config: &OSConfig) -> AppResult> { + fn down(&self, config: &OSConfig) -> Result> { let key_data = self.key_data(); let script = PathBuf::from(key_data.task_name).join("down.nu"); let task_config = if let Some(key) = key_data.config_key { diff --git a/src/task/chrooting/mapping.rs b/src/task/chrooting/mapping.rs index 2650030..7ec2764 100644 --- a/src/task/chrooting/mapping.rs +++ b/src/task/chrooting/mapping.rs @@ -142,9 +142,9 @@ impl Mapping { } fs::symlink(src, dst) .await - .map_err(|e| ChrootError::Link(dst.to_owned(), e))?; + .map_err(|e| ChrootError::Link(src.to_owned(), e))?; Ok(MappingHandle::Link(LinkDrop { - path: dst.to_owned(), + path: src.to_owned(), })) } @@ -152,12 +152,12 @@ impl Mapping { if dst.exists() && dst.is_file() { fs::remove_file(dst) .await - .map_err(|e| ChrootError::Copy(dst.to_owned(), e))?; + .map_err(|e| ChrootError::Copy(src.to_owned(), e))?; } fs::copy(src, dst) .await - .map_err(|e| ChrootError::Copy(dst.to_owned(), e))?; + .map_err(|e| ChrootError::Copy(src.to_owned(), e))?; Ok(MappingHandle::None) } diff --git a/src/task/chrooting/setup.rs b/src/task/chrooting/setup.rs index 02b4435..ce894a8 100644 --- a/src/task/chrooting/setup.rs +++ b/src/task/chrooting/setup.rs @@ -5,10 +5,11 @@ use tokio::fs; use crate::error::ChrootError; use super::{mapping::default_mappings, Chroot}; +use miette::Result; impl Chroot { /// Creates a new chroot with the given path - pub async fn create>(root_path: P) -> Result { + pub async fn create>(root_path: P) -> Result { let root_path = root_path.into(); if !root_path.exists() { fs::create_dir_all(&root_path) diff --git a/src/task/custom_task.rs b/src/task/custom_task.rs index 132143c..aca36db 100644 --- a/src/task/custom_task.rs +++ b/src/task/custom_task.rs @@ -2,9 +2,10 @@ use std::path::PathBuf; use embed_nu::IntoValue; -use crate::{distro::OSConfig, error::AppResult}; +use crate::distro::OSConfig; use super::{exec_builder::ExecBuilder, TaskTrait}; +use miette::Result; #[derive(Clone, Debug)] pub struct CustomTask { @@ -35,7 +36,7 @@ impl CustomTask { impl TaskTrait for CustomTask { #[tracing::instrument(level = "trace", skip_all)] - fn up(&self, config: &OSConfig) -> AppResult> { + fn up(&self, config: &OSConfig) -> Result> { let task_config = if let Some(key) = self.config_key.as_ref() { config.get_nu_value(key)? } else { @@ -52,7 +53,7 @@ impl TaskTrait for CustomTask { } #[tracing::instrument(level = "trace", skip_all)] - fn down(&self, config: &OSConfig) -> AppResult> { + fn down(&self, config: &OSConfig) -> Result> { let task_config = if let Some(key) = self.config_key.as_ref() { config.get_nu_value(key)? } else { diff --git a/src/task/exec_builder.rs b/src/task/exec_builder.rs index 38fcd08..3260cae 100644 --- a/src/task/exec_builder.rs +++ b/src/task/exec_builder.rs @@ -1,14 +1,15 @@ use std::path::{Path, PathBuf}; -use embed_nu::{Argument, CommandGroupConfig, Context, ValueIntoExpression}; +use embed_nu::{Argument, CommandGroupConfig, ValueIntoExpression}; use std::fs; use crate::{distro::OSConfig, error::ScriptError, utils::CFG_PATH}; +use miette::{Context, IntoDiagnostic, Result}; #[derive(Clone)] pub struct ExecBuilder { task_config: embed_nu::Value, - ctx: Context, + ctx: embed_nu::Context, } impl ExecBuilder { @@ -16,29 +17,36 @@ impl ExecBuilder { script: PathBuf, os_config: OSConfig, task_config: embed_nu::Value, - ) -> Result { + ) -> Result { let script_contents = Self::get_script_contents(&script)?; - let mut ctx = Context::builder() - .with_command_groups(CommandGroupConfig::default().all_groups(true))? + let mut ctx = embed_nu::Context::builder() + .with_command_groups(CommandGroupConfig::default().all_groups(true)) + .into_diagnostic()? .add_parent_env_vars() - .add_var("TRM_CONFIG", os_config)? - .add_script(script_contents)? - .build()?; + .add_var("TRM_CONFIG", os_config) + .into_diagnostic()? + .add_script(script_contents) + .into_diagnostic()? + .build() + .into_diagnostic()?; if !ctx.has_fn("main") { - Err(ScriptError::MissingMain(script)) + Err(ScriptError::MissingMain(script).into()) } else { Ok(Self { ctx, task_config }) } } #[tracing::instrument(level = "trace", skip_all)] - pub fn exec(mut self) -> Result<(), ScriptError> { - let pipeline = self.ctx.call_fn( - "main", - vec![Argument::Positional(self.task_config.into_expression())], - )?; - self.ctx.print_pipeline_stderr(pipeline)?; + pub fn exec(mut self) -> Result<()> { + let pipeline = self + .ctx + .call_fn( + "main", + vec![Argument::Positional(self.task_config.into_expression())], + ) + .into_diagnostic()?; + self.ctx.print_pipeline_stderr(pipeline).into_diagnostic()?; Ok(()) } @@ -52,13 +60,16 @@ impl ExecBuilder { } #[tracing::instrument(level = "trace", skip_all)] - fn get_script_contents(path: &Path) -> Result { + fn get_script_contents(path: &Path) -> Result { let path = CFG_PATH.join(path); if path.exists() { - fs::read_to_string(path).map_err(ScriptError::from) + fs::read_to_string(path) + .map_err(ScriptError::from) + .into_diagnostic() + .context("reading script contents") } else { - Err(ScriptError::ScriptNotFound(path)) + Err(ScriptError::ScriptNotFound(path).into()) } } } diff --git a/src/task/mod.rs b/src/task/mod.rs index 327218c..82c25ed 100644 --- a/src/task/mod.rs +++ b/src/task/mod.rs @@ -1,6 +1,6 @@ use std::cmp::Ordering; -use crate::{distro::OSConfig, error::AppResult}; +use crate::distro::OSConfig; use self::{base_task::BaseTask, custom_task::CustomTask, exec_builder::ExecBuilder}; pub mod base_task; @@ -8,10 +8,11 @@ mod chrooting; pub mod custom_task; pub mod exec_builder; pub mod task_executor; +use miette::Result; pub trait TaskTrait { - fn up(&self, config: &OSConfig) -> AppResult>; - fn down(&self, config: &OSConfig) -> AppResult>; + fn up(&self, config: &OSConfig) -> Result>; + fn down(&self, config: &OSConfig) -> Result>; /// Used to decide the execution order /// smaller values mean the task get's executed earlier fn order(&self) -> usize; @@ -50,7 +51,7 @@ impl Task { impl TaskTrait for Task { #[inline] - fn up(&self, config: &OSConfig) -> AppResult> { + fn up(&self, config: &OSConfig) -> Result> { match self { Task::Base(b) => b.up(config), Task::Custom(c) => c.up(config), @@ -58,7 +59,7 @@ impl TaskTrait for Task { } #[inline] - fn down(&self, config: &OSConfig) -> AppResult> { + fn down(&self, config: &OSConfig) -> Result> { match self { Task::Base(b) => b.down(config), Task::Custom(c) => c.down(config), diff --git a/src/task/task_executor.rs b/src/task/task_executor.rs index 8bb8d13..399da04 100644 --- a/src/task/task_executor.rs +++ b/src/task/task_executor.rs @@ -1,6 +1,5 @@ use crate::{ distro::{distro_config::DistroConfig, OSConfig}, - error::AppResult, utils::ROOT_MNT, }; @@ -13,6 +12,7 @@ pub struct TaskExecutor { os_config: OSConfig, tasks: Vec, } +use miette::Result; impl TaskExecutor { /// Creates a new task executor with the given OSConfig and Distro Config @@ -61,7 +61,7 @@ impl TaskExecutor { /// Executes all tasks #[tracing::instrument(level = "trace", skip_all)] - pub async fn execute(&mut self) -> AppResult<()> { + pub async fn execute(&mut self) -> Result<()> { self.tasks.sort_by(Task::compare); let chroot = Chroot::create(&*ROOT_MNT).await?; diff --git a/src/utils.rs b/src/utils.rs index 6d7520a..ef654a6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -3,8 +3,8 @@ use std::{env, path::PathBuf}; use tokio::fs; -use crate::error::AppResult; use crate::task::base_task::ALL_BASE_TASKS; +use miette::{Context, IntoDiagnostic, Result}; const DEFAULT_CONFIG_DIR: &str = "/etc"; @@ -19,7 +19,7 @@ macro_rules! env_cfg { env_cfg!(CFG_PATH: PathBuf <- "TRM_CFG_PATH" default PathBuf::from(DEFAULT_CONFIG_DIR).join("tourmaline")); env_cfg!(ROOT_MNT: PathBuf <- "TRM_ROOT_MNT" default PathBuf::from("/mnt")); -pub async fn generate_script_files>(output: P) -> AppResult<()> { +pub async fn generate_script_files>(output: P) -> Result<()> { let output = output.as_ref(); for task in &*ALL_BASE_TASKS { @@ -28,7 +28,10 @@ pub async fn generate_script_files>(output: P) -> AppResult<()> { let script_dir = output.join(name); if !script_dir.exists() { - fs::create_dir_all(&script_dir).await?; + fs::create_dir_all(&script_dir) + .await + .into_diagnostic() + .context("creating script dir")?; } let up_path = output.join("up.nu"); let down_path = output.join("down.nu"); @@ -43,7 +46,9 @@ def main [cfg] {{ "# ), ) - .await?; + .await + .into_diagnostic() + .context("writing up task content")?; fs::write( &down_path, @@ -56,7 +61,9 @@ def main [cfg] {{ ) .trim(), ) - .await?; + .await + .into_diagnostic() + .context("writing down task content")?; } Ok(())