summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2023-04-27 10:08:20 +0200
committerFxQnLr <[email protected]>2023-04-27 10:08:20 +0200
commit4e6466af1329f7b9e341df2e76ab696d11f80c93 (patch)
treeeef58fecfadad90386b38af581abab8cc3d3cfc0
parentf1912007484f077b5585a872ca732d087beefa9a (diff)
downloadmodlist-4e6466af1329f7b9e341df2e76ab696d11f80c93.tar
modlist-4e6466af1329f7b9e341df2e76ab696d11f80c93.tar.gz
modlist-4e6466af1329f7b9e341df2e76ab696d11f80c93.zip
version bump, cargo fmt and cargo update
-rw-r--r--Cargo.lock139
-rw-r--r--src/cache.rs5
-rw-r--r--src/config.rs13
-rw-r--r--src/db.rs1
-rw-r--r--src/files.rs19
-rw-r--r--src/lib.rs2
-rw-r--r--src/main.rs22
7 files changed, 106 insertions, 95 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b591837..f25b161 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -39,9 +39,9 @@ dependencies = [
39 39
40[[package]] 40[[package]]
41name = "anstream" 41name = "anstream"
42version = "0.3.0" 42version = "0.3.1"
43source = "registry+https://github.com/rust-lang/crates.io-index" 43source = "registry+https://github.com/rust-lang/crates.io-index"
44checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" 44checksum = "6342bd4f5a1205d7f41e94a41a901f5647c938cdfa96036338e8533c9d6c2450"
45dependencies = [ 45dependencies = [
46 "anstyle", 46 "anstyle",
47 "anstyle-parse", 47 "anstyle-parse",
@@ -78,9 +78,9 @@ dependencies = [
78 78
79[[package]] 79[[package]]
80name = "anstyle-wincon" 80name = "anstyle-wincon"
81version = "1.0.0" 81version = "1.0.1"
82source = "registry+https://github.com/rust-lang/crates.io-index" 82source = "registry+https://github.com/rust-lang/crates.io-index"
83checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" 83checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
84dependencies = [ 84dependencies = [
85 "anstyle", 85 "anstyle",
86 "windows-sys 0.48.0", 86 "windows-sys 0.48.0",
@@ -121,15 +121,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
121 121
122[[package]] 122[[package]]
123name = "bitflags" 123name = "bitflags"
124version = "2.0.2" 124version = "2.2.1"
125source = "registry+https://github.com/rust-lang/crates.io-index" 125source = "registry+https://github.com/rust-lang/crates.io-index"
126checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" 126checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813"
127 127
128[[package]] 128[[package]]
129name = "bumpalo" 129name = "bumpalo"
130version = "3.12.0" 130version = "3.12.1"
131source = "registry+https://github.com/rust-lang/crates.io-index" 131source = "registry+https://github.com/rust-lang/crates.io-index"
132checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" 132checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"
133 133
134[[package]] 134[[package]]
135name = "bytes" 135name = "bytes"
@@ -166,9 +166,9 @@ dependencies = [
166 166
167[[package]] 167[[package]]
168name = "clap" 168name = "clap"
169version = "4.2.2" 169version = "4.2.4"
170source = "registry+https://github.com/rust-lang/crates.io-index" 170source = "registry+https://github.com/rust-lang/crates.io-index"
171checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a" 171checksum = "956ac1f6381d8d82ab4684768f89c0ea3afe66925ceadb4eeb3fc452ffc55d62"
172dependencies = [ 172dependencies = [
173 "clap_builder", 173 "clap_builder",
174 "clap_derive", 174 "clap_derive",
@@ -177,9 +177,9 @@ dependencies = [
177 177
178[[package]] 178[[package]]
179name = "clap_builder" 179name = "clap_builder"
180version = "4.2.2" 180version = "4.2.4"
181source = "registry+https://github.com/rust-lang/crates.io-index" 181source = "registry+https://github.com/rust-lang/crates.io-index"
182checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6" 182checksum = "84080e799e54cff944f4b4a4b0e71630b0e0443b25b985175c7dddc1a859b749"
183dependencies = [ 183dependencies = [
184 "anstream", 184 "anstream",
185 "anstyle", 185 "anstyle",
@@ -190,9 +190,9 @@ dependencies = [
190 190
191[[package]] 191[[package]]
192name = "clap_complete" 192name = "clap_complete"
193version = "4.2.0" 193version = "4.2.1"
194source = "registry+https://github.com/rust-lang/crates.io-index" 194source = "registry+https://github.com/rust-lang/crates.io-index"
195checksum = "01c22dcfb410883764b29953103d9ef7bb8fe21b3fa1158bc99986c2067294bd" 195checksum = "1a19591b2ab0e3c04b588a0e04ddde7b9eaa423646d1b4a8092879216bf47473"
196dependencies = [ 196dependencies = [
197 "clap", 197 "clap",
198] 198]
@@ -206,7 +206,7 @@ dependencies = [
206 "heck", 206 "heck",
207 "proc-macro2", 207 "proc-macro2",
208 "quote", 208 "quote",
209 "syn 2.0.13", 209 "syn 2.0.15",
210] 210]
211 211
212[[package]] 212[[package]]
@@ -271,7 +271,7 @@ dependencies = [
271 "proc-macro2", 271 "proc-macro2",
272 "quote", 272 "quote",
273 "scratch", 273 "scratch",
274 "syn 2.0.13", 274 "syn 2.0.15",
275] 275]
276 276
277[[package]] 277[[package]]
@@ -288,7 +288,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
288dependencies = [ 288dependencies = [
289 "proc-macro2", 289 "proc-macro2",
290 "quote", 290 "quote",
291 "syn 2.0.13", 291 "syn 2.0.15",
292] 292]
293 293
294[[package]] 294[[package]]
@@ -322,13 +322,13 @@ dependencies = [
322 322
323[[package]] 323[[package]]
324name = "errno" 324name = "errno"
325version = "0.3.0" 325version = "0.3.1"
326source = "registry+https://github.com/rust-lang/crates.io-index" 326source = "registry+https://github.com/rust-lang/crates.io-index"
327checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" 327checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
328dependencies = [ 328dependencies = [
329 "errno-dragonfly", 329 "errno-dragonfly",
330 "libc", 330 "libc",
331 "windows-sys 0.45.0", 331 "windows-sys 0.48.0",
332] 332]
333 333
334[[package]] 334[[package]]
@@ -431,7 +431,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
431dependencies = [ 431dependencies = [
432 "proc-macro2", 432 "proc-macro2",
433 "quote", 433 "quote",
434 "syn 2.0.13", 434 "syn 2.0.15",
435] 435]
436 436
437[[package]] 437[[package]]
@@ -465,9 +465,9 @@ dependencies = [
465 465
466[[package]] 466[[package]]
467name = "getrandom" 467name = "getrandom"
468version = "0.2.8" 468version = "0.2.9"
469source = "registry+https://github.com/rust-lang/crates.io-index" 469source = "registry+https://github.com/rust-lang/crates.io-index"
470checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 470checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
471dependencies = [ 471dependencies = [
472 "cfg-if", 472 "cfg-if",
473 "libc", 473 "libc",
@@ -482,9 +482,9 @@ checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
482 482
483[[package]] 483[[package]]
484name = "h2" 484name = "h2"
485version = "0.3.16" 485version = "0.3.18"
486source = "registry+https://github.com/rust-lang/crates.io-index" 486source = "registry+https://github.com/rust-lang/crates.io-index"
487checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" 487checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
488dependencies = [ 488dependencies = [
489 "bytes", 489 "bytes",
490 "fnv", 490 "fnv",
@@ -574,9 +574,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
574 574
575[[package]] 575[[package]]
576name = "hyper" 576name = "hyper"
577version = "0.14.25" 577version = "0.14.26"
578source = "registry+https://github.com/rust-lang/crates.io-index" 578source = "registry+https://github.com/rust-lang/crates.io-index"
579checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" 579checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
580dependencies = [ 580dependencies = [
581 "bytes", 581 "bytes",
582 "futures-channel", 582 "futures-channel",
@@ -664,13 +664,13 @@ dependencies = [
664 664
665[[package]] 665[[package]]
666name = "io-lifetimes" 666name = "io-lifetimes"
667version = "1.0.9" 667version = "1.0.10"
668source = "registry+https://github.com/rust-lang/crates.io-index" 668source = "registry+https://github.com/rust-lang/crates.io-index"
669checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" 669checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
670dependencies = [ 670dependencies = [
671 "hermit-abi 0.3.1", 671 "hermit-abi 0.3.1",
672 "libc", 672 "libc",
673 "windows-sys 0.45.0", 673 "windows-sys 0.48.0",
674] 674]
675 675
676[[package]] 676[[package]]
@@ -681,14 +681,14 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"
681 681
682[[package]] 682[[package]]
683name = "is-terminal" 683name = "is-terminal"
684version = "0.4.6" 684version = "0.4.7"
685source = "registry+https://github.com/rust-lang/crates.io-index" 685source = "registry+https://github.com/rust-lang/crates.io-index"
686checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" 686checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"
687dependencies = [ 687dependencies = [
688 "hermit-abi 0.3.1", 688 "hermit-abi 0.3.1",
689 "io-lifetimes", 689 "io-lifetimes",
690 "rustix", 690 "rustix",
691 "windows-sys 0.45.0", 691 "windows-sys 0.48.0",
692] 692]
693 693
694[[package]] 694[[package]]
@@ -714,9 +714,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
714 714
715[[package]] 715[[package]]
716name = "libc" 716name = "libc"
717version = "0.2.141" 717version = "0.2.142"
718source = "registry+https://github.com/rust-lang/crates.io-index" 718source = "registry+https://github.com/rust-lang/crates.io-index"
719checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" 719checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317"
720 720
721[[package]] 721[[package]]
722name = "libsqlite3-sys" 722name = "libsqlite3-sys"
@@ -740,9 +740,9 @@ dependencies = [
740 740
741[[package]] 741[[package]]
742name = "linux-raw-sys" 742name = "linux-raw-sys"
743version = "0.3.1" 743version = "0.3.4"
744source = "registry+https://github.com/rust-lang/crates.io-index" 744source = "registry+https://github.com/rust-lang/crates.io-index"
745checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" 745checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf"
746 746
747[[package]] 747[[package]]
748name = "lock_api" 748name = "lock_api"
@@ -798,7 +798,7 @@ dependencies = [
798 798
799[[package]] 799[[package]]
800name = "modlist" 800name = "modlist"
801version = "0.13.0" 801version = "0.13.1"
802dependencies = [ 802dependencies = [
803 "chrono", 803 "chrono",
804 "clap", 804 "clap",
@@ -878,9 +878,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
878 878
879[[package]] 879[[package]]
880name = "openssl" 880name = "openssl"
881version = "0.10.49" 881version = "0.10.52"
882source = "registry+https://github.com/rust-lang/crates.io-index" 882source = "registry+https://github.com/rust-lang/crates.io-index"
883checksum = "4d2f106ab837a24e03672c59b1239669a0596406ff657c3c0835b6b7f0f35a33" 883checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56"
884dependencies = [ 884dependencies = [
885 "bitflags 1.3.2", 885 "bitflags 1.3.2",
886 "cfg-if", 886 "cfg-if",
@@ -899,7 +899,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
899dependencies = [ 899dependencies = [
900 "proc-macro2", 900 "proc-macro2",
901 "quote", 901 "quote",
902 "syn 2.0.13", 902 "syn 2.0.15",
903] 903]
904 904
905[[package]] 905[[package]]
@@ -910,9 +910,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
910 910
911[[package]] 911[[package]]
912name = "openssl-sys" 912name = "openssl-sys"
913version = "0.9.84" 913version = "0.9.87"
914source = "registry+https://github.com/rust-lang/crates.io-index" 914source = "registry+https://github.com/rust-lang/crates.io-index"
915checksum = "3a20eace9dc2d82904039cb76dcf50fb1a0bba071cfd1629720b5d6f1ddba0fa" 915checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e"
916dependencies = [ 916dependencies = [
917 "cc", 917 "cc",
918 "libc", 918 "libc",
@@ -1059,7 +1059,7 @@ version = "0.29.0"
1059source = "registry+https://github.com/rust-lang/crates.io-index" 1059source = "registry+https://github.com/rust-lang/crates.io-index"
1060checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" 1060checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2"
1061dependencies = [ 1061dependencies = [
1062 "bitflags 2.0.2", 1062 "bitflags 2.2.1",
1063 "fallible-iterator", 1063 "fallible-iterator",
1064 "fallible-streaming-iterator", 1064 "fallible-streaming-iterator",
1065 "hashlink", 1065 "hashlink",
@@ -1069,22 +1069,22 @@ dependencies = [
1069 1069
1070[[package]] 1070[[package]]
1071name = "rustc-demangle" 1071name = "rustc-demangle"
1072version = "0.1.22" 1072version = "0.1.23"
1073source = "registry+https://github.com/rust-lang/crates.io-index" 1073source = "registry+https://github.com/rust-lang/crates.io-index"
1074checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" 1074checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
1075 1075
1076[[package]] 1076[[package]]
1077name = "rustix" 1077name = "rustix"
1078version = "0.37.7" 1078version = "0.37.15"
1079source = "registry+https://github.com/rust-lang/crates.io-index" 1079source = "registry+https://github.com/rust-lang/crates.io-index"
1080checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" 1080checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece"
1081dependencies = [ 1081dependencies = [
1082 "bitflags 1.3.2", 1082 "bitflags 1.3.2",
1083 "errno", 1083 "errno",
1084 "io-lifetimes", 1084 "io-lifetimes",
1085 "libc", 1085 "libc",
1086 "linux-raw-sys", 1086 "linux-raw-sys",
1087 "windows-sys 0.45.0", 1087 "windows-sys 0.48.0",
1088] 1088]
1089 1089
1090[[package]] 1090[[package]]
@@ -1139,29 +1139,29 @@ dependencies = [
1139 1139
1140[[package]] 1140[[package]]
1141name = "serde" 1141name = "serde"
1142version = "1.0.159" 1142version = "1.0.160"
1143source = "registry+https://github.com/rust-lang/crates.io-index" 1143source = "registry+https://github.com/rust-lang/crates.io-index"
1144checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" 1144checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
1145dependencies = [ 1145dependencies = [
1146 "serde_derive", 1146 "serde_derive",
1147] 1147]
1148 1148
1149[[package]] 1149[[package]]
1150name = "serde_derive" 1150name = "serde_derive"
1151version = "1.0.159" 1151version = "1.0.160"
1152source = "registry+https://github.com/rust-lang/crates.io-index" 1152source = "registry+https://github.com/rust-lang/crates.io-index"
1153checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" 1153checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
1154dependencies = [ 1154dependencies = [
1155 "proc-macro2", 1155 "proc-macro2",
1156 "quote", 1156 "quote",
1157 "syn 2.0.13", 1157 "syn 2.0.15",
1158] 1158]
1159 1159
1160[[package]] 1160[[package]]
1161name = "serde_json" 1161name = "serde_json"
1162version = "1.0.95" 1162version = "1.0.96"
1163source = "registry+https://github.com/rust-lang/crates.io-index" 1163source = "registry+https://github.com/rust-lang/crates.io-index"
1164checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" 1164checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
1165dependencies = [ 1165dependencies = [
1166 "itoa", 1166 "itoa",
1167 "ryu", 1167 "ryu",
@@ -1242,9 +1242,9 @@ dependencies = [
1242 1242
1243[[package]] 1243[[package]]
1244name = "syn" 1244name = "syn"
1245version = "2.0.13" 1245version = "2.0.15"
1246source = "registry+https://github.com/rust-lang/crates.io-index" 1246source = "registry+https://github.com/rust-lang/crates.io-index"
1247checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" 1247checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
1248dependencies = [ 1248dependencies = [
1249 "proc-macro2", 1249 "proc-macro2",
1250 "quote", 1250 "quote",
@@ -1290,7 +1290,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
1290dependencies = [ 1290dependencies = [
1291 "proc-macro2", 1291 "proc-macro2",
1292 "quote", 1292 "quote",
1293 "syn 2.0.13", 1293 "syn 2.0.15",
1294] 1294]
1295 1295
1296[[package]] 1296[[package]]
@@ -1321,9 +1321,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1321 1321
1322[[package]] 1322[[package]]
1323name = "tokio" 1323name = "tokio"
1324version = "1.27.0" 1324version = "1.28.0"
1325source = "registry+https://github.com/rust-lang/crates.io-index" 1325source = "registry+https://github.com/rust-lang/crates.io-index"
1326checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" 1326checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f"
1327dependencies = [ 1327dependencies = [
1328 "autocfg", 1328 "autocfg",
1329 "bytes", 1329 "bytes",
@@ -1335,18 +1335,18 @@ dependencies = [
1335 "signal-hook-registry", 1335 "signal-hook-registry",
1336 "socket2", 1336 "socket2",
1337 "tokio-macros", 1337 "tokio-macros",
1338 "windows-sys 0.45.0", 1338 "windows-sys 0.48.0",
1339] 1339]
1340 1340
1341[[package]] 1341[[package]]
1342name = "tokio-macros" 1342name = "tokio-macros"
1343version = "2.0.0" 1343version = "2.1.0"
1344source = "registry+https://github.com/rust-lang/crates.io-index" 1344source = "registry+https://github.com/rust-lang/crates.io-index"
1345checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" 1345checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
1346dependencies = [ 1346dependencies = [
1347 "proc-macro2", 1347 "proc-macro2",
1348 "quote", 1348 "quote",
1349 "syn 2.0.13", 1349 "syn 2.0.15",
1350] 1350]
1351 1351
1352[[package]] 1352[[package]]
@@ -1361,9 +1361,9 @@ dependencies = [
1361 1361
1362[[package]] 1362[[package]]
1363name = "tokio-util" 1363name = "tokio-util"
1364version = "0.7.7" 1364version = "0.7.8"
1365source = "registry+https://github.com/rust-lang/crates.io-index" 1365source = "registry+https://github.com/rust-lang/crates.io-index"
1366checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 1366checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d"
1367dependencies = [ 1367dependencies = [
1368 "bytes", 1368 "bytes",
1369 "futures-core", 1369 "futures-core",
@@ -1415,11 +1415,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
1415 1415
1416[[package]] 1416[[package]]
1417name = "tracing" 1417name = "tracing"
1418version = "0.1.37" 1418version = "0.1.38"
1419source = "registry+https://github.com/rust-lang/crates.io-index" 1419source = "registry+https://github.com/rust-lang/crates.io-index"
1420checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1420checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d"
1421dependencies = [ 1421dependencies = [
1422 "cfg-if",
1423 "pin-project-lite", 1422 "pin-project-lite",
1424 "tracing-core", 1423 "tracing-core",
1425] 1424]
diff --git a/src/cache.rs b/src/cache.rs
index 44029e0..11645d1 100644
--- a/src/cache.rs
+++ b/src/cache.rs
@@ -1,4 +1,7 @@
1use std::{collections::HashMap, fs::{read_dir, copy}}; 1use std::{
2 collections::HashMap,
3 fs::{copy, read_dir},
4};
2 5
3/// . 6/// .
4/// 7///
diff --git a/src/config.rs b/src/config.rs
index 817d22b..61db1c7 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,11 +1,12 @@
1use std::{ 1use std::{
2 fs::{File, create_dir_all}, 2 fs::{create_dir_all, File},
3 io::{Read, Write}, path::Path, 3 io::{Read, Write},
4 path::Path,
4}; 5};
5 6
6use serde::{Deserialize, Serialize}; 7use serde::{Deserialize, Serialize};
7 8
8use crate::{error::MLE, db::db_setup}; 9use crate::{db::db_setup, error::MLE};
9 10
10#[derive(Debug, Clone, Serialize, Deserialize)] 11#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct Cfg { 12pub struct Cfg {
@@ -23,7 +24,11 @@ impl Cfg {
23 pub fn init(path: Option<String>) -> MLE<Self> { 24 pub fn init(path: Option<String>) -> MLE<Self> {
24 let configfile = match path.clone() { 25 let configfile = match path.clone() {
25 Some(p) => String::from(p), 26 Some(p) => String::from(p),
26 None => dirs::config_dir().unwrap().join("modlist.toml").to_string_lossy().to_string(), 27 None => dirs::config_dir()
28 .unwrap()
29 .join("modlist.toml")
30 .to_string_lossy()
31 .to_string(),
27 }; 32 };
28 33
29 let mut file = match File::open(&configfile) { 34 let mut file = match File::open(&configfile) {
diff --git a/src/db.rs b/src/db.rs
index 36fab75..abfe1dd 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -702,7 +702,6 @@ pub fn s_insert_column(
702} 702}
703 703
704pub fn db_setup(path: &str) -> MLE<()> { 704pub fn db_setup(path: &str) -> MLE<()> {
705
706 let connection = Connection::open(path)?; 705 let connection = Connection::open(path)?;
707 706
708 connection.execute_batch( 707 connection.execute_batch(
diff --git a/src/files.rs b/src/files.rs
index a73fc18..59fc7de 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -2,20 +2,20 @@ use futures_util::StreamExt;
2use reqwest::Client; 2use reqwest::Client;
3use std::{ 3use std::{
4 collections::HashMap, 4 collections::HashMap,
5 fs::{read_dir, remove_file, rename, File, copy}, 5 fs::{copy, read_dir, remove_file, rename, File},
6 io::Write, 6 io::Write,
7}; 7};
8 8
9use crate::{ 9use crate::{
10 cache::{copy_cached_version, get_cached_versions},
10 config::Cfg, 11 config::Cfg,
11 db::{mods_get_info, userlist_add_disabled_versions}, 12 db::{mods_get_info, userlist_add_disabled_versions},
12 error::{ErrorType, MLError, MLE}, 13 error::{ErrorType, MLError, MLE},
13 modrinth::Version, 14 modrinth::Version,
14 List, cache::{get_cached_versions, copy_cached_version}, 15 List,
15}; 16};
16 17
17pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> { 18pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> {
18
19 let mut cached = get_cached_versions(&config.cache); 19 let mut cached = get_cached_versions(&config.cache);
20 20
21 println!("{:#?}", cached); 21 println!("{:#?}", cached);
@@ -30,7 +30,10 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>)
30 //Check cache if already downloaded 30 //Check cache if already downloaded
31 let c = cached.remove(&ver.id); 31 let c = cached.remove(&ver.id);
32 if c.is_some() { 32 if c.is_some() {
33 print!("\t└({})Get version {} from cache", project_info.title, ver.id); 33 print!(
34 "\t└({})Get version {} from cache",
35 project_info.title, ver.id
36 );
34 //Force flush of stdout, else print! doesn't print instantly 37 //Force flush of stdout, else print! doesn't print instantly
35 std::io::stdout().flush()?; 38 std::io::stdout().flush()?;
36 copy_cached_version(&c.unwrap(), &dl_path); 39 copy_cached_version(&c.unwrap(), &dl_path);
@@ -52,7 +55,12 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>)
52 ver.id, 55 ver.id,
53 extension 56 extension
54 ); 57 );
55 download_file(primary_file.url, list.clone().download_folder, filename.clone()).await?; 58 download_file(
59 primary_file.url,
60 list.clone().download_folder,
61 filename.clone(),
62 )
63 .await?;
56 println!(" ✓"); 64 println!(" ✓");
57 //Copy file to cache 65 //Copy file to cache
58 print!("\t └Copy to cache"); 66 print!("\t └Copy to cache");
@@ -64,7 +72,6 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>)
64 copy(dl_path_file, cache_path)?; 72 copy(dl_path_file, cache_path)?;
65 println!(" ✓"); 73 println!(" ✓");
66 } 74 }
67
68 } 75 }
69 76
70 Ok(dl_path) 77 Ok(dl_path)
diff --git a/src/lib.rs b/src/lib.rs
index 0bf3076..185edd7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,10 +1,10 @@
1pub mod apis; 1pub mod apis;
2pub mod cache;
2pub mod commands; 3pub mod commands;
3pub mod config; 4pub mod config;
4pub mod db; 5pub mod db;
5pub mod error; 6pub mod error;
6pub mod files; 7pub mod files;
7pub mod cache;
8 8
9use std::fmt::Display; 9use std::fmt::Display;
10 10
diff --git a/src/main.rs b/src/main.rs
index 30c4001..0ecb850 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,8 +2,8 @@ use clap::{Parser, Subcommand};
2use modlist::{ 2use modlist::{
3 config::Cfg, 3 config::Cfg,
4 db::{config_get_current_list, lists_get, lists_get_all_ids}, 4 db::{config_get_current_list, lists_get, lists_get_all_ids},
5 download, export, get_current_list, import, list_add, list_change, list_remove, 5 download, export, get_current_list, import, list_add, list_change, list_remove, list_version,
6 list_version, mod_add, mod_remove, update, IDSelector, List, Modloader, 6 mod_add, mod_remove, update, IDSelector, List, Modloader,
7}; 7};
8 8
9//TODO implement remote sql db 9//TODO implement remote sql db
@@ -14,7 +14,7 @@ use modlist::{
14struct Cli { 14struct Cli {
15 #[command(subcommand)] 15 #[command(subcommand)]
16 command: Commands, 16 command: Commands,
17 17
18 /// config file path 18 /// config file path
19 #[arg(short, long)] 19 #[arg(short, long)]
20 config: Option<String>, 20 config: Option<String>,
@@ -146,7 +146,7 @@ enum ListCommands {
146#[tokio::main] 146#[tokio::main]
147async fn main() { 147async fn main() {
148 let cli = Cli::parse(); 148 let cli = Cli::parse();
149 149
150 let config = Cfg::init(cli.config).unwrap(); 150 let config = Cfg::init(cli.config).unwrap();
151 println!("{:?}", config); 151 println!("{:?}", config);
152 152
@@ -253,14 +253,12 @@ async fn main() {
253 Commands::Import { file, download } => { 253 Commands::Import { file, download } => {
254 let filestr: String = match file { 254 let filestr: String = match file {
255 Some(args) => args, 255 Some(args) => args,
256 None => 256 None => dirs::home_dir()
257 dirs::home_dir() 257 .unwrap()
258 .unwrap() 258 .join("mlexport.toml")
259 .join("mlexport.toml") 259 .into_os_string()
260 .into_os_string() 260 .into_string()
261 .into_string() 261 .unwrap(),
262 .unwrap()
263 ,
264 }; 262 };
265 263
266 import(config, filestr, download).await 264 import(config, filestr, download).await