├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md └── src ├── cmds ├── cmd_env.rs ├── cmd_install.rs ├── cmd_list.rs ├── cmd_uninstall.rs ├── cmd_use.rs ├── example.rs └── mod.rs ├── main.rs ├── snippets └── env.sh └── utils.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.17.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aes" 22 | version = "0.7.5" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" 25 | dependencies = [ 26 | "cfg-if", 27 | "cipher", 28 | "cpufeatures", 29 | "opaque-debug", 30 | ] 31 | 32 | [[package]] 33 | name = "aho-corasick" 34 | version = "0.7.18" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 37 | dependencies = [ 38 | "memchr", 39 | ] 40 | 41 | [[package]] 42 | name = "arc-swap" 43 | version = "1.5.1" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164" 46 | 47 | [[package]] 48 | name = "async-trait" 49 | version = "0.1.57" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" 52 | dependencies = [ 53 | "proc-macro2", 54 | "quote", 55 | "syn", 56 | ] 57 | 58 | [[package]] 59 | name = "atty" 60 | version = "0.2.14" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 63 | dependencies = [ 64 | "hermit-abi", 65 | "libc", 66 | "winapi", 67 | ] 68 | 69 | [[package]] 70 | name = "autocfg" 71 | version = "1.1.0" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 74 | 75 | [[package]] 76 | name = "backtrace" 77 | version = "0.3.66" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" 80 | dependencies = [ 81 | "addr2line", 82 | "cc", 83 | "cfg-if", 84 | "libc", 85 | "miniz_oxide", 86 | "object", 87 | "rustc-demangle", 88 | ] 89 | 90 | [[package]] 91 | name = "base64" 92 | version = "0.13.0" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 95 | 96 | [[package]] 97 | name = "base64ct" 98 | version = "1.0.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" 101 | 102 | [[package]] 103 | name = "bitflags" 104 | version = "1.3.2" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 107 | 108 | [[package]] 109 | name = "block-buffer" 110 | version = "0.10.2" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" 113 | dependencies = [ 114 | "generic-array", 115 | ] 116 | 117 | [[package]] 118 | name = "bumpalo" 119 | version = "3.10.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" 122 | 123 | [[package]] 124 | name = "bvm" 125 | version = "0.1.1" 126 | dependencies = [ 127 | "bytes", 128 | "clap", 129 | "dialoguer", 130 | "directories", 131 | "futures-util", 132 | "indicatif", 133 | "octocrab", 134 | "regex", 135 | "reqwest", 136 | "semver", 137 | "serde", 138 | "serde_derive", 139 | "tinytemplate", 140 | "tokio", 141 | "uuid", 142 | "zip", 143 | ] 144 | 145 | [[package]] 146 | name = "byteorder" 147 | version = "1.4.3" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 150 | 151 | [[package]] 152 | name = "bytes" 153 | version = "1.1.0" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 156 | 157 | [[package]] 158 | name = "bzip2" 159 | version = "0.4.3" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" 162 | dependencies = [ 163 | "bzip2-sys", 164 | "libc", 165 | ] 166 | 167 | [[package]] 168 | name = "bzip2-sys" 169 | version = "0.1.11+1.0.8" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" 172 | dependencies = [ 173 | "cc", 174 | "libc", 175 | "pkg-config", 176 | ] 177 | 178 | [[package]] 179 | name = "cc" 180 | version = "1.0.73" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 183 | dependencies = [ 184 | "jobserver", 185 | ] 186 | 187 | [[package]] 188 | name = "cfg-if" 189 | version = "1.0.0" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 192 | 193 | [[package]] 194 | name = "chrono" 195 | version = "0.4.20" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "6127248204b9aba09a362f6c930ef6a78f2c1b2215f8a7b398c06e1083f17af0" 198 | dependencies = [ 199 | "js-sys", 200 | "num-integer", 201 | "num-traits", 202 | "serde", 203 | "time 0.1.44", 204 | "wasm-bindgen", 205 | "winapi", 206 | ] 207 | 208 | [[package]] 209 | name = "cipher" 210 | version = "0.3.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" 213 | dependencies = [ 214 | "generic-array", 215 | ] 216 | 217 | [[package]] 218 | name = "clap" 219 | version = "3.2.16" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9" 222 | dependencies = [ 223 | "atty", 224 | "bitflags", 225 | "clap_derive", 226 | "clap_lex", 227 | "indexmap", 228 | "once_cell", 229 | "strsim", 230 | "termcolor", 231 | "textwrap", 232 | ] 233 | 234 | [[package]] 235 | name = "clap_derive" 236 | version = "3.2.15" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4" 239 | dependencies = [ 240 | "heck", 241 | "proc-macro-error", 242 | "proc-macro2", 243 | "quote", 244 | "syn", 245 | ] 246 | 247 | [[package]] 248 | name = "clap_lex" 249 | version = "0.2.4" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" 252 | dependencies = [ 253 | "os_str_bytes", 254 | ] 255 | 256 | [[package]] 257 | name = "console" 258 | version = "0.15.1" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" 261 | dependencies = [ 262 | "encode_unicode", 263 | "libc", 264 | "once_cell", 265 | "terminal_size", 266 | "unicode-width", 267 | "winapi", 268 | ] 269 | 270 | [[package]] 271 | name = "constant_time_eq" 272 | version = "0.1.5" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" 275 | 276 | [[package]] 277 | name = "core-foundation" 278 | version = "0.9.3" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 281 | dependencies = [ 282 | "core-foundation-sys", 283 | "libc", 284 | ] 285 | 286 | [[package]] 287 | name = "core-foundation-sys" 288 | version = "0.8.3" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 291 | 292 | [[package]] 293 | name = "cpufeatures" 294 | version = "0.2.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" 297 | dependencies = [ 298 | "libc", 299 | ] 300 | 301 | [[package]] 302 | name = "crc32fast" 303 | version = "1.3.2" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 306 | dependencies = [ 307 | "cfg-if", 308 | ] 309 | 310 | [[package]] 311 | name = "crossbeam-utils" 312 | version = "0.8.11" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" 315 | dependencies = [ 316 | "cfg-if", 317 | "once_cell", 318 | ] 319 | 320 | [[package]] 321 | name = "crypto-common" 322 | version = "0.1.6" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 325 | dependencies = [ 326 | "generic-array", 327 | "typenum", 328 | ] 329 | 330 | [[package]] 331 | name = "dialoguer" 332 | version = "0.10.2" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "a92e7e37ecef6857fdc0c0c5d42fd5b0938e46590c2183cc92dd310a6d078eb1" 335 | dependencies = [ 336 | "console", 337 | "tempfile", 338 | "zeroize", 339 | ] 340 | 341 | [[package]] 342 | name = "digest" 343 | version = "0.10.3" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" 346 | dependencies = [ 347 | "block-buffer", 348 | "crypto-common", 349 | "subtle", 350 | ] 351 | 352 | [[package]] 353 | name = "directories" 354 | version = "4.0.1" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" 357 | dependencies = [ 358 | "dirs-sys", 359 | ] 360 | 361 | [[package]] 362 | name = "dirs-sys" 363 | version = "0.3.7" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 366 | dependencies = [ 367 | "libc", 368 | "redox_users", 369 | "winapi", 370 | ] 371 | 372 | [[package]] 373 | name = "doc-comment" 374 | version = "0.3.3" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" 377 | 378 | [[package]] 379 | name = "encode_unicode" 380 | version = "0.3.6" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 383 | 384 | [[package]] 385 | name = "encoding_rs" 386 | version = "0.8.31" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" 389 | dependencies = [ 390 | "cfg-if", 391 | ] 392 | 393 | [[package]] 394 | name = "fastrand" 395 | version = "1.8.0" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" 398 | dependencies = [ 399 | "instant", 400 | ] 401 | 402 | [[package]] 403 | name = "flate2" 404 | version = "1.0.24" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" 407 | dependencies = [ 408 | "crc32fast", 409 | "miniz_oxide", 410 | ] 411 | 412 | [[package]] 413 | name = "fnv" 414 | version = "1.0.7" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 417 | 418 | [[package]] 419 | name = "foreign-types" 420 | version = "0.3.2" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 423 | dependencies = [ 424 | "foreign-types-shared", 425 | ] 426 | 427 | [[package]] 428 | name = "foreign-types-shared" 429 | version = "0.1.1" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 432 | 433 | [[package]] 434 | name = "form_urlencoded" 435 | version = "1.0.1" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 438 | dependencies = [ 439 | "matches", 440 | "percent-encoding", 441 | ] 442 | 443 | [[package]] 444 | name = "futures-channel" 445 | version = "0.3.21" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 448 | dependencies = [ 449 | "futures-core", 450 | ] 451 | 452 | [[package]] 453 | name = "futures-core" 454 | version = "0.3.21" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 457 | 458 | [[package]] 459 | name = "futures-macro" 460 | version = "0.3.21" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 463 | dependencies = [ 464 | "proc-macro2", 465 | "quote", 466 | "syn", 467 | ] 468 | 469 | [[package]] 470 | name = "futures-sink" 471 | version = "0.3.21" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 474 | 475 | [[package]] 476 | name = "futures-task" 477 | version = "0.3.21" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 480 | 481 | [[package]] 482 | name = "futures-util" 483 | version = "0.3.21" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 486 | dependencies = [ 487 | "futures-core", 488 | "futures-macro", 489 | "futures-task", 490 | "pin-project-lite", 491 | "pin-utils", 492 | "slab", 493 | ] 494 | 495 | [[package]] 496 | name = "generic-array" 497 | version = "0.14.6" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 500 | dependencies = [ 501 | "typenum", 502 | "version_check", 503 | ] 504 | 505 | [[package]] 506 | name = "getrandom" 507 | version = "0.2.7" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" 510 | dependencies = [ 511 | "cfg-if", 512 | "libc", 513 | "wasi 0.11.0+wasi-snapshot-preview1", 514 | ] 515 | 516 | [[package]] 517 | name = "gimli" 518 | version = "0.26.2" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" 521 | 522 | [[package]] 523 | name = "h2" 524 | version = "0.3.13" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" 527 | dependencies = [ 528 | "bytes", 529 | "fnv", 530 | "futures-core", 531 | "futures-sink", 532 | "futures-util", 533 | "http", 534 | "indexmap", 535 | "slab", 536 | "tokio", 537 | "tokio-util", 538 | "tracing", 539 | ] 540 | 541 | [[package]] 542 | name = "hashbrown" 543 | version = "0.12.3" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 546 | 547 | [[package]] 548 | name = "heck" 549 | version = "0.4.0" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 552 | 553 | [[package]] 554 | name = "hermit-abi" 555 | version = "0.1.19" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 558 | dependencies = [ 559 | "libc", 560 | ] 561 | 562 | [[package]] 563 | name = "hmac" 564 | version = "0.12.1" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 567 | dependencies = [ 568 | "digest", 569 | ] 570 | 571 | [[package]] 572 | name = "http" 573 | version = "0.2.8" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 576 | dependencies = [ 577 | "bytes", 578 | "fnv", 579 | "itoa", 580 | ] 581 | 582 | [[package]] 583 | name = "http-body" 584 | version = "0.4.5" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 587 | dependencies = [ 588 | "bytes", 589 | "http", 590 | "pin-project-lite", 591 | ] 592 | 593 | [[package]] 594 | name = "httparse" 595 | version = "1.7.1" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" 598 | 599 | [[package]] 600 | name = "httpdate" 601 | version = "1.0.2" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 604 | 605 | [[package]] 606 | name = "hyper" 607 | version = "0.14.20" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" 610 | dependencies = [ 611 | "bytes", 612 | "futures-channel", 613 | "futures-core", 614 | "futures-util", 615 | "h2", 616 | "http", 617 | "http-body", 618 | "httparse", 619 | "httpdate", 620 | "itoa", 621 | "pin-project-lite", 622 | "socket2", 623 | "tokio", 624 | "tower-service", 625 | "tracing", 626 | "want", 627 | ] 628 | 629 | [[package]] 630 | name = "hyper-tls" 631 | version = "0.5.0" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 634 | dependencies = [ 635 | "bytes", 636 | "hyper", 637 | "native-tls", 638 | "tokio", 639 | "tokio-native-tls", 640 | ] 641 | 642 | [[package]] 643 | name = "hyperx" 644 | version = "1.4.0" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "5617e92fc2f2501c3e2bc6ce547cad841adba2bae5b921c7e52510beca6d084c" 647 | dependencies = [ 648 | "base64", 649 | "bytes", 650 | "http", 651 | "httpdate", 652 | "language-tags", 653 | "mime", 654 | "percent-encoding", 655 | "unicase", 656 | ] 657 | 658 | [[package]] 659 | name = "idna" 660 | version = "0.2.3" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 663 | dependencies = [ 664 | "matches", 665 | "unicode-bidi", 666 | "unicode-normalization", 667 | ] 668 | 669 | [[package]] 670 | name = "indexmap" 671 | version = "1.9.1" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 674 | dependencies = [ 675 | "autocfg", 676 | "hashbrown", 677 | ] 678 | 679 | [[package]] 680 | name = "indicatif" 681 | version = "0.15.0" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" 684 | dependencies = [ 685 | "console", 686 | "lazy_static", 687 | "number_prefix", 688 | "regex", 689 | ] 690 | 691 | [[package]] 692 | name = "instant" 693 | version = "0.1.12" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 696 | dependencies = [ 697 | "cfg-if", 698 | ] 699 | 700 | [[package]] 701 | name = "ipnet" 702 | version = "2.5.0" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" 705 | 706 | [[package]] 707 | name = "itoa" 708 | version = "1.0.3" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" 711 | 712 | [[package]] 713 | name = "jobserver" 714 | version = "0.1.24" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" 717 | dependencies = [ 718 | "libc", 719 | ] 720 | 721 | [[package]] 722 | name = "js-sys" 723 | version = "0.3.59" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" 726 | dependencies = [ 727 | "wasm-bindgen", 728 | ] 729 | 730 | [[package]] 731 | name = "jsonwebtoken" 732 | version = "8.1.1" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c" 735 | dependencies = [ 736 | "base64", 737 | "pem", 738 | "ring", 739 | "serde", 740 | "serde_json", 741 | "simple_asn1", 742 | ] 743 | 744 | [[package]] 745 | name = "language-tags" 746 | version = "0.3.2" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 749 | 750 | [[package]] 751 | name = "lazy_static" 752 | version = "1.4.0" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 755 | 756 | [[package]] 757 | name = "libc" 758 | version = "0.2.127" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "505e71a4706fa491e9b1b55f51b95d4037d0821ee40131190475f692b35b009b" 761 | 762 | [[package]] 763 | name = "lock_api" 764 | version = "0.4.7" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" 767 | dependencies = [ 768 | "autocfg", 769 | "scopeguard", 770 | ] 771 | 772 | [[package]] 773 | name = "log" 774 | version = "0.4.17" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 777 | dependencies = [ 778 | "cfg-if", 779 | ] 780 | 781 | [[package]] 782 | name = "matches" 783 | version = "0.1.9" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 786 | 787 | [[package]] 788 | name = "memchr" 789 | version = "2.5.0" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 792 | 793 | [[package]] 794 | name = "mime" 795 | version = "0.3.16" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 798 | 799 | [[package]] 800 | name = "miniz_oxide" 801 | version = "0.5.3" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" 804 | dependencies = [ 805 | "adler", 806 | ] 807 | 808 | [[package]] 809 | name = "mio" 810 | version = "0.8.4" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" 813 | dependencies = [ 814 | "libc", 815 | "log", 816 | "wasi 0.11.0+wasi-snapshot-preview1", 817 | "windows-sys", 818 | ] 819 | 820 | [[package]] 821 | name = "native-tls" 822 | version = "0.2.10" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" 825 | dependencies = [ 826 | "lazy_static", 827 | "libc", 828 | "log", 829 | "openssl", 830 | "openssl-probe", 831 | "openssl-sys", 832 | "schannel", 833 | "security-framework", 834 | "security-framework-sys", 835 | "tempfile", 836 | ] 837 | 838 | [[package]] 839 | name = "num-bigint" 840 | version = "0.4.3" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" 843 | dependencies = [ 844 | "autocfg", 845 | "num-integer", 846 | "num-traits", 847 | ] 848 | 849 | [[package]] 850 | name = "num-integer" 851 | version = "0.1.45" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 854 | dependencies = [ 855 | "autocfg", 856 | "num-traits", 857 | ] 858 | 859 | [[package]] 860 | name = "num-traits" 861 | version = "0.2.15" 862 | source = "registry+https://github.com/rust-lang/crates.io-index" 863 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 864 | dependencies = [ 865 | "autocfg", 866 | ] 867 | 868 | [[package]] 869 | name = "num_cpus" 870 | version = "1.13.1" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 873 | dependencies = [ 874 | "hermit-abi", 875 | "libc", 876 | ] 877 | 878 | [[package]] 879 | name = "num_threads" 880 | version = "0.1.6" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" 883 | dependencies = [ 884 | "libc", 885 | ] 886 | 887 | [[package]] 888 | name = "number_prefix" 889 | version = "0.3.0" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" 892 | 893 | [[package]] 894 | name = "object" 895 | version = "0.29.0" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" 898 | dependencies = [ 899 | "memchr", 900 | ] 901 | 902 | [[package]] 903 | name = "octocrab" 904 | version = "0.16.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "8d3731cf8af31e9df81c7f529d3907f8a01c6ffea0cb8a989a637f66a9201a23" 907 | dependencies = [ 908 | "arc-swap", 909 | "async-trait", 910 | "base64", 911 | "bytes", 912 | "chrono", 913 | "hyperx", 914 | "jsonwebtoken", 915 | "once_cell", 916 | "reqwest", 917 | "secrecy", 918 | "serde", 919 | "serde_json", 920 | "serde_path_to_error", 921 | "snafu", 922 | "url", 923 | ] 924 | 925 | [[package]] 926 | name = "once_cell" 927 | version = "1.13.0" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" 930 | 931 | [[package]] 932 | name = "opaque-debug" 933 | version = "0.3.0" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 936 | 937 | [[package]] 938 | name = "openssl" 939 | version = "0.10.41" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" 942 | dependencies = [ 943 | "bitflags", 944 | "cfg-if", 945 | "foreign-types", 946 | "libc", 947 | "once_cell", 948 | "openssl-macros", 949 | "openssl-sys", 950 | ] 951 | 952 | [[package]] 953 | name = "openssl-macros" 954 | version = "0.1.0" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 957 | dependencies = [ 958 | "proc-macro2", 959 | "quote", 960 | "syn", 961 | ] 962 | 963 | [[package]] 964 | name = "openssl-probe" 965 | version = "0.1.5" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 968 | 969 | [[package]] 970 | name = "openssl-sys" 971 | version = "0.9.75" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" 974 | dependencies = [ 975 | "autocfg", 976 | "cc", 977 | "libc", 978 | "pkg-config", 979 | "vcpkg", 980 | ] 981 | 982 | [[package]] 983 | name = "os_str_bytes" 984 | version = "6.2.0" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" 987 | 988 | [[package]] 989 | name = "parking_lot" 990 | version = "0.12.1" 991 | source = "registry+https://github.com/rust-lang/crates.io-index" 992 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 993 | dependencies = [ 994 | "lock_api", 995 | "parking_lot_core", 996 | ] 997 | 998 | [[package]] 999 | name = "parking_lot_core" 1000 | version = "0.9.3" 1001 | source = "registry+https://github.com/rust-lang/crates.io-index" 1002 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" 1003 | dependencies = [ 1004 | "cfg-if", 1005 | "libc", 1006 | "redox_syscall", 1007 | "smallvec", 1008 | "windows-sys", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "password-hash" 1013 | version = "0.3.2" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" 1016 | dependencies = [ 1017 | "base64ct", 1018 | "rand_core", 1019 | "subtle", 1020 | ] 1021 | 1022 | [[package]] 1023 | name = "pbkdf2" 1024 | version = "0.10.1" 1025 | source = "registry+https://github.com/rust-lang/crates.io-index" 1026 | checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" 1027 | dependencies = [ 1028 | "digest", 1029 | "hmac", 1030 | "password-hash", 1031 | "sha2", 1032 | ] 1033 | 1034 | [[package]] 1035 | name = "pem" 1036 | version = "1.1.0" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" 1039 | dependencies = [ 1040 | "base64", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "percent-encoding" 1045 | version = "2.1.0" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1048 | 1049 | [[package]] 1050 | name = "pin-project-lite" 1051 | version = "0.2.9" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1054 | 1055 | [[package]] 1056 | name = "pin-utils" 1057 | version = "0.1.0" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1060 | 1061 | [[package]] 1062 | name = "pkg-config" 1063 | version = "0.3.25" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" 1066 | 1067 | [[package]] 1068 | name = "ppv-lite86" 1069 | version = "0.2.16" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1072 | 1073 | [[package]] 1074 | name = "proc-macro-error" 1075 | version = "1.0.4" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1078 | dependencies = [ 1079 | "proc-macro-error-attr", 1080 | "proc-macro2", 1081 | "quote", 1082 | "syn", 1083 | "version_check", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "proc-macro-error-attr" 1088 | version = "1.0.4" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1091 | dependencies = [ 1092 | "proc-macro2", 1093 | "quote", 1094 | "version_check", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "proc-macro2" 1099 | version = "1.0.43" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" 1102 | dependencies = [ 1103 | "unicode-ident", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "quote" 1108 | version = "1.0.21" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 1111 | dependencies = [ 1112 | "proc-macro2", 1113 | ] 1114 | 1115 | [[package]] 1116 | name = "rand" 1117 | version = "0.8.5" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1120 | dependencies = [ 1121 | "libc", 1122 | "rand_chacha", 1123 | "rand_core", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "rand_chacha" 1128 | version = "0.3.1" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1131 | dependencies = [ 1132 | "ppv-lite86", 1133 | "rand_core", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "rand_core" 1138 | version = "0.6.3" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 1141 | dependencies = [ 1142 | "getrandom", 1143 | ] 1144 | 1145 | [[package]] 1146 | name = "redox_syscall" 1147 | version = "0.2.16" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1150 | dependencies = [ 1151 | "bitflags", 1152 | ] 1153 | 1154 | [[package]] 1155 | name = "redox_users" 1156 | version = "0.4.3" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1159 | dependencies = [ 1160 | "getrandom", 1161 | "redox_syscall", 1162 | "thiserror", 1163 | ] 1164 | 1165 | [[package]] 1166 | name = "regex" 1167 | version = "1.6.0" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" 1170 | dependencies = [ 1171 | "aho-corasick", 1172 | "memchr", 1173 | "regex-syntax", 1174 | ] 1175 | 1176 | [[package]] 1177 | name = "regex-syntax" 1178 | version = "0.6.27" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" 1181 | 1182 | [[package]] 1183 | name = "remove_dir_all" 1184 | version = "0.5.3" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1187 | dependencies = [ 1188 | "winapi", 1189 | ] 1190 | 1191 | [[package]] 1192 | name = "reqwest" 1193 | version = "0.11.11" 1194 | source = "registry+https://github.com/rust-lang/crates.io-index" 1195 | checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" 1196 | dependencies = [ 1197 | "base64", 1198 | "bytes", 1199 | "encoding_rs", 1200 | "futures-core", 1201 | "futures-util", 1202 | "h2", 1203 | "http", 1204 | "http-body", 1205 | "hyper", 1206 | "hyper-tls", 1207 | "ipnet", 1208 | "js-sys", 1209 | "lazy_static", 1210 | "log", 1211 | "mime", 1212 | "native-tls", 1213 | "percent-encoding", 1214 | "pin-project-lite", 1215 | "serde", 1216 | "serde_json", 1217 | "serde_urlencoded", 1218 | "tokio", 1219 | "tokio-native-tls", 1220 | "tokio-util", 1221 | "tower-service", 1222 | "url", 1223 | "wasm-bindgen", 1224 | "wasm-bindgen-futures", 1225 | "web-sys", 1226 | "winreg", 1227 | ] 1228 | 1229 | [[package]] 1230 | name = "ring" 1231 | version = "0.16.20" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 1234 | dependencies = [ 1235 | "cc", 1236 | "libc", 1237 | "once_cell", 1238 | "spin", 1239 | "untrusted", 1240 | "web-sys", 1241 | "winapi", 1242 | ] 1243 | 1244 | [[package]] 1245 | name = "rustc-demangle" 1246 | version = "0.1.21" 1247 | source = "registry+https://github.com/rust-lang/crates.io-index" 1248 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 1249 | 1250 | [[package]] 1251 | name = "ryu" 1252 | version = "1.0.11" 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" 1254 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 1255 | 1256 | [[package]] 1257 | name = "schannel" 1258 | version = "0.1.20" 1259 | source = "registry+https://github.com/rust-lang/crates.io-index" 1260 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" 1261 | dependencies = [ 1262 | "lazy_static", 1263 | "windows-sys", 1264 | ] 1265 | 1266 | [[package]] 1267 | name = "scopeguard" 1268 | version = "1.1.0" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1271 | 1272 | [[package]] 1273 | name = "secrecy" 1274 | version = "0.8.0" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" 1277 | dependencies = [ 1278 | "zeroize", 1279 | ] 1280 | 1281 | [[package]] 1282 | name = "security-framework" 1283 | version = "2.6.1" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" 1286 | dependencies = [ 1287 | "bitflags", 1288 | "core-foundation", 1289 | "core-foundation-sys", 1290 | "libc", 1291 | "security-framework-sys", 1292 | ] 1293 | 1294 | [[package]] 1295 | name = "security-framework-sys" 1296 | version = "2.6.1" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 1299 | dependencies = [ 1300 | "core-foundation-sys", 1301 | "libc", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "semver" 1306 | version = "1.0.13" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" 1309 | 1310 | [[package]] 1311 | name = "serde" 1312 | version = "1.0.142" 1313 | source = "registry+https://github.com/rust-lang/crates.io-index" 1314 | checksum = "e590c437916fb6b221e1d00df6e3294f3fccd70ca7e92541c475d6ed6ef5fee2" 1315 | dependencies = [ 1316 | "serde_derive", 1317 | ] 1318 | 1319 | [[package]] 1320 | name = "serde_derive" 1321 | version = "1.0.142" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "34b5b8d809babe02f538c2cfec6f2c1ed10804c0e5a6a041a049a4f5588ccc2e" 1324 | dependencies = [ 1325 | "proc-macro2", 1326 | "quote", 1327 | "syn", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "serde_json" 1332 | version = "1.0.83" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" 1335 | dependencies = [ 1336 | "itoa", 1337 | "ryu", 1338 | "serde", 1339 | ] 1340 | 1341 | [[package]] 1342 | name = "serde_path_to_error" 1343 | version = "0.1.8" 1344 | source = "registry+https://github.com/rust-lang/crates.io-index" 1345 | checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" 1346 | dependencies = [ 1347 | "serde", 1348 | ] 1349 | 1350 | [[package]] 1351 | name = "serde_urlencoded" 1352 | version = "0.7.1" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1355 | dependencies = [ 1356 | "form_urlencoded", 1357 | "itoa", 1358 | "ryu", 1359 | "serde", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "sha1" 1364 | version = "0.10.1" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" 1367 | dependencies = [ 1368 | "cfg-if", 1369 | "cpufeatures", 1370 | "digest", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "sha2" 1375 | version = "0.10.2" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" 1378 | dependencies = [ 1379 | "cfg-if", 1380 | "cpufeatures", 1381 | "digest", 1382 | ] 1383 | 1384 | [[package]] 1385 | name = "signal-hook-registry" 1386 | version = "1.4.0" 1387 | source = "registry+https://github.com/rust-lang/crates.io-index" 1388 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1389 | dependencies = [ 1390 | "libc", 1391 | ] 1392 | 1393 | [[package]] 1394 | name = "simple_asn1" 1395 | version = "0.6.2" 1396 | source = "registry+https://github.com/rust-lang/crates.io-index" 1397 | checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" 1398 | dependencies = [ 1399 | "num-bigint", 1400 | "num-traits", 1401 | "thiserror", 1402 | "time 0.3.12", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "slab" 1407 | version = "0.4.7" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" 1410 | dependencies = [ 1411 | "autocfg", 1412 | ] 1413 | 1414 | [[package]] 1415 | name = "smallvec" 1416 | version = "1.9.0" 1417 | source = "registry+https://github.com/rust-lang/crates.io-index" 1418 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" 1419 | 1420 | [[package]] 1421 | name = "snafu" 1422 | version = "0.7.1" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "5177903bf45656592d9eb5c0e22f408fc023aae51dbe2088889b71633ba451f2" 1425 | dependencies = [ 1426 | "backtrace", 1427 | "doc-comment", 1428 | "snafu-derive", 1429 | ] 1430 | 1431 | [[package]] 1432 | name = "snafu-derive" 1433 | version = "0.7.1" 1434 | source = "registry+https://github.com/rust-lang/crates.io-index" 1435 | checksum = "410b26ed97440d90ced3e2488c868d56a86e2064f5d7d6f417909b286afe25e5" 1436 | dependencies = [ 1437 | "heck", 1438 | "proc-macro2", 1439 | "quote", 1440 | "syn", 1441 | ] 1442 | 1443 | [[package]] 1444 | name = "socket2" 1445 | version = "0.4.4" 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" 1447 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1448 | dependencies = [ 1449 | "libc", 1450 | "winapi", 1451 | ] 1452 | 1453 | [[package]] 1454 | name = "spin" 1455 | version = "0.5.2" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1458 | 1459 | [[package]] 1460 | name = "strsim" 1461 | version = "0.10.0" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1464 | 1465 | [[package]] 1466 | name = "subtle" 1467 | version = "2.4.1" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1470 | 1471 | [[package]] 1472 | name = "syn" 1473 | version = "1.0.99" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" 1476 | dependencies = [ 1477 | "proc-macro2", 1478 | "quote", 1479 | "unicode-ident", 1480 | ] 1481 | 1482 | [[package]] 1483 | name = "tempfile" 1484 | version = "3.3.0" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 1487 | dependencies = [ 1488 | "cfg-if", 1489 | "fastrand", 1490 | "libc", 1491 | "redox_syscall", 1492 | "remove_dir_all", 1493 | "winapi", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "termcolor" 1498 | version = "1.1.3" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 1501 | dependencies = [ 1502 | "winapi-util", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "terminal_size" 1507 | version = "0.1.17" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" 1510 | dependencies = [ 1511 | "libc", 1512 | "winapi", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "textwrap" 1517 | version = "0.15.0" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" 1520 | 1521 | [[package]] 1522 | name = "thiserror" 1523 | version = "1.0.32" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" 1526 | dependencies = [ 1527 | "thiserror-impl", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "thiserror-impl" 1532 | version = "1.0.32" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" 1535 | dependencies = [ 1536 | "proc-macro2", 1537 | "quote", 1538 | "syn", 1539 | ] 1540 | 1541 | [[package]] 1542 | name = "time" 1543 | version = "0.1.44" 1544 | source = "registry+https://github.com/rust-lang/crates.io-index" 1545 | checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" 1546 | dependencies = [ 1547 | "libc", 1548 | "wasi 0.10.0+wasi-snapshot-preview1", 1549 | "winapi", 1550 | ] 1551 | 1552 | [[package]] 1553 | name = "time" 1554 | version = "0.3.12" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "74b7cc93fc23ba97fde84f7eea56c55d1ba183f495c6715defdfc7b9cb8c870f" 1557 | dependencies = [ 1558 | "itoa", 1559 | "js-sys", 1560 | "libc", 1561 | "num_threads", 1562 | "time-macros", 1563 | ] 1564 | 1565 | [[package]] 1566 | name = "time-macros" 1567 | version = "0.2.4" 1568 | source = "registry+https://github.com/rust-lang/crates.io-index" 1569 | checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" 1570 | 1571 | [[package]] 1572 | name = "tinytemplate" 1573 | version = "1.2.1" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 1576 | dependencies = [ 1577 | "serde", 1578 | "serde_json", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "tinyvec" 1583 | version = "1.6.0" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1586 | dependencies = [ 1587 | "tinyvec_macros", 1588 | ] 1589 | 1590 | [[package]] 1591 | name = "tinyvec_macros" 1592 | version = "0.1.0" 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" 1594 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1595 | 1596 | [[package]] 1597 | name = "tokio" 1598 | version = "1.20.1" 1599 | source = "registry+https://github.com/rust-lang/crates.io-index" 1600 | checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" 1601 | dependencies = [ 1602 | "autocfg", 1603 | "bytes", 1604 | "libc", 1605 | "memchr", 1606 | "mio", 1607 | "num_cpus", 1608 | "once_cell", 1609 | "parking_lot", 1610 | "pin-project-lite", 1611 | "signal-hook-registry", 1612 | "socket2", 1613 | "tokio-macros", 1614 | "winapi", 1615 | ] 1616 | 1617 | [[package]] 1618 | name = "tokio-macros" 1619 | version = "1.8.0" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" 1622 | dependencies = [ 1623 | "proc-macro2", 1624 | "quote", 1625 | "syn", 1626 | ] 1627 | 1628 | [[package]] 1629 | name = "tokio-native-tls" 1630 | version = "0.3.0" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1633 | dependencies = [ 1634 | "native-tls", 1635 | "tokio", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "tokio-util" 1640 | version = "0.7.3" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" 1643 | dependencies = [ 1644 | "bytes", 1645 | "futures-core", 1646 | "futures-sink", 1647 | "pin-project-lite", 1648 | "tokio", 1649 | "tracing", 1650 | ] 1651 | 1652 | [[package]] 1653 | name = "tower-service" 1654 | version = "0.3.2" 1655 | source = "registry+https://github.com/rust-lang/crates.io-index" 1656 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1657 | 1658 | [[package]] 1659 | name = "tracing" 1660 | version = "0.1.36" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" 1663 | dependencies = [ 1664 | "cfg-if", 1665 | "pin-project-lite", 1666 | "tracing-core", 1667 | ] 1668 | 1669 | [[package]] 1670 | name = "tracing-core" 1671 | version = "0.1.29" 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" 1673 | checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" 1674 | dependencies = [ 1675 | "once_cell", 1676 | ] 1677 | 1678 | [[package]] 1679 | name = "try-lock" 1680 | version = "0.2.3" 1681 | source = "registry+https://github.com/rust-lang/crates.io-index" 1682 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1683 | 1684 | [[package]] 1685 | name = "typenum" 1686 | version = "1.15.0" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1689 | 1690 | [[package]] 1691 | name = "unicase" 1692 | version = "2.6.0" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1695 | dependencies = [ 1696 | "version_check", 1697 | ] 1698 | 1699 | [[package]] 1700 | name = "unicode-bidi" 1701 | version = "0.3.8" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 1704 | 1705 | [[package]] 1706 | name = "unicode-ident" 1707 | version = "1.0.3" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" 1710 | 1711 | [[package]] 1712 | name = "unicode-normalization" 1713 | version = "0.1.21" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" 1716 | dependencies = [ 1717 | "tinyvec", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "unicode-width" 1722 | version = "0.1.9" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1725 | 1726 | [[package]] 1727 | name = "untrusted" 1728 | version = "0.7.1" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 1731 | 1732 | [[package]] 1733 | name = "url" 1734 | version = "2.2.2" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1737 | dependencies = [ 1738 | "form_urlencoded", 1739 | "idna", 1740 | "matches", 1741 | "percent-encoding", 1742 | "serde", 1743 | ] 1744 | 1745 | [[package]] 1746 | name = "uuid" 1747 | version = "1.1.2" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" 1750 | dependencies = [ 1751 | "getrandom", 1752 | "rand", 1753 | "uuid-macro-internal", 1754 | ] 1755 | 1756 | [[package]] 1757 | name = "uuid-macro-internal" 1758 | version = "1.1.2" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "548f7181a5990efa50237abb7ebca410828b57a8955993334679f8b50b35c97d" 1761 | dependencies = [ 1762 | "proc-macro2", 1763 | "quote", 1764 | "syn", 1765 | ] 1766 | 1767 | [[package]] 1768 | name = "vcpkg" 1769 | version = "0.2.15" 1770 | source = "registry+https://github.com/rust-lang/crates.io-index" 1771 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1772 | 1773 | [[package]] 1774 | name = "version_check" 1775 | version = "0.9.4" 1776 | source = "registry+https://github.com/rust-lang/crates.io-index" 1777 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1778 | 1779 | [[package]] 1780 | name = "want" 1781 | version = "0.3.0" 1782 | source = "registry+https://github.com/rust-lang/crates.io-index" 1783 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1784 | dependencies = [ 1785 | "log", 1786 | "try-lock", 1787 | ] 1788 | 1789 | [[package]] 1790 | name = "wasi" 1791 | version = "0.10.0+wasi-snapshot-preview1" 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" 1793 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 1794 | 1795 | [[package]] 1796 | name = "wasi" 1797 | version = "0.11.0+wasi-snapshot-preview1" 1798 | source = "registry+https://github.com/rust-lang/crates.io-index" 1799 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1800 | 1801 | [[package]] 1802 | name = "wasm-bindgen" 1803 | version = "0.2.82" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" 1806 | dependencies = [ 1807 | "cfg-if", 1808 | "wasm-bindgen-macro", 1809 | ] 1810 | 1811 | [[package]] 1812 | name = "wasm-bindgen-backend" 1813 | version = "0.2.82" 1814 | source = "registry+https://github.com/rust-lang/crates.io-index" 1815 | checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" 1816 | dependencies = [ 1817 | "bumpalo", 1818 | "log", 1819 | "once_cell", 1820 | "proc-macro2", 1821 | "quote", 1822 | "syn", 1823 | "wasm-bindgen-shared", 1824 | ] 1825 | 1826 | [[package]] 1827 | name = "wasm-bindgen-futures" 1828 | version = "0.4.32" 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" 1830 | checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" 1831 | dependencies = [ 1832 | "cfg-if", 1833 | "js-sys", 1834 | "wasm-bindgen", 1835 | "web-sys", 1836 | ] 1837 | 1838 | [[package]] 1839 | name = "wasm-bindgen-macro" 1840 | version = "0.2.82" 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" 1842 | checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" 1843 | dependencies = [ 1844 | "quote", 1845 | "wasm-bindgen-macro-support", 1846 | ] 1847 | 1848 | [[package]] 1849 | name = "wasm-bindgen-macro-support" 1850 | version = "0.2.82" 1851 | source = "registry+https://github.com/rust-lang/crates.io-index" 1852 | checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" 1853 | dependencies = [ 1854 | "proc-macro2", 1855 | "quote", 1856 | "syn", 1857 | "wasm-bindgen-backend", 1858 | "wasm-bindgen-shared", 1859 | ] 1860 | 1861 | [[package]] 1862 | name = "wasm-bindgen-shared" 1863 | version = "0.2.82" 1864 | source = "registry+https://github.com/rust-lang/crates.io-index" 1865 | checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" 1866 | 1867 | [[package]] 1868 | name = "web-sys" 1869 | version = "0.3.59" 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" 1871 | checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" 1872 | dependencies = [ 1873 | "js-sys", 1874 | "wasm-bindgen", 1875 | ] 1876 | 1877 | [[package]] 1878 | name = "winapi" 1879 | version = "0.3.9" 1880 | source = "registry+https://github.com/rust-lang/crates.io-index" 1881 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1882 | dependencies = [ 1883 | "winapi-i686-pc-windows-gnu", 1884 | "winapi-x86_64-pc-windows-gnu", 1885 | ] 1886 | 1887 | [[package]] 1888 | name = "winapi-i686-pc-windows-gnu" 1889 | version = "0.4.0" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1892 | 1893 | [[package]] 1894 | name = "winapi-util" 1895 | version = "0.1.5" 1896 | source = "registry+https://github.com/rust-lang/crates.io-index" 1897 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1898 | dependencies = [ 1899 | "winapi", 1900 | ] 1901 | 1902 | [[package]] 1903 | name = "winapi-x86_64-pc-windows-gnu" 1904 | version = "0.4.0" 1905 | source = "registry+https://github.com/rust-lang/crates.io-index" 1906 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1907 | 1908 | [[package]] 1909 | name = "windows-sys" 1910 | version = "0.36.1" 1911 | source = "registry+https://github.com/rust-lang/crates.io-index" 1912 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 1913 | dependencies = [ 1914 | "windows_aarch64_msvc", 1915 | "windows_i686_gnu", 1916 | "windows_i686_msvc", 1917 | "windows_x86_64_gnu", 1918 | "windows_x86_64_msvc", 1919 | ] 1920 | 1921 | [[package]] 1922 | name = "windows_aarch64_msvc" 1923 | version = "0.36.1" 1924 | source = "registry+https://github.com/rust-lang/crates.io-index" 1925 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 1926 | 1927 | [[package]] 1928 | name = "windows_i686_gnu" 1929 | version = "0.36.1" 1930 | source = "registry+https://github.com/rust-lang/crates.io-index" 1931 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 1932 | 1933 | [[package]] 1934 | name = "windows_i686_msvc" 1935 | version = "0.36.1" 1936 | source = "registry+https://github.com/rust-lang/crates.io-index" 1937 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 1938 | 1939 | [[package]] 1940 | name = "windows_x86_64_gnu" 1941 | version = "0.36.1" 1942 | source = "registry+https://github.com/rust-lang/crates.io-index" 1943 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 1944 | 1945 | [[package]] 1946 | name = "windows_x86_64_msvc" 1947 | version = "0.36.1" 1948 | source = "registry+https://github.com/rust-lang/crates.io-index" 1949 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 1950 | 1951 | [[package]] 1952 | name = "winreg" 1953 | version = "0.10.1" 1954 | source = "registry+https://github.com/rust-lang/crates.io-index" 1955 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 1956 | dependencies = [ 1957 | "winapi", 1958 | ] 1959 | 1960 | [[package]] 1961 | name = "zeroize" 1962 | version = "1.5.7" 1963 | source = "registry+https://github.com/rust-lang/crates.io-index" 1964 | checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" 1965 | 1966 | [[package]] 1967 | name = "zip" 1968 | version = "0.6.2" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" 1971 | dependencies = [ 1972 | "aes", 1973 | "byteorder", 1974 | "bzip2", 1975 | "constant_time_eq", 1976 | "crc32fast", 1977 | "crossbeam-utils", 1978 | "flate2", 1979 | "hmac", 1980 | "pbkdf2", 1981 | "sha1", 1982 | "time 0.3.12", 1983 | "zstd", 1984 | ] 1985 | 1986 | [[package]] 1987 | name = "zstd" 1988 | version = "0.10.2+zstd.1.5.2" 1989 | source = "registry+https://github.com/rust-lang/crates.io-index" 1990 | checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" 1991 | dependencies = [ 1992 | "zstd-safe", 1993 | ] 1994 | 1995 | [[package]] 1996 | name = "zstd-safe" 1997 | version = "4.1.6+zstd.1.5.2" 1998 | source = "registry+https://github.com/rust-lang/crates.io-index" 1999 | checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" 2000 | dependencies = [ 2001 | "libc", 2002 | "zstd-sys", 2003 | ] 2004 | 2005 | [[package]] 2006 | name = "zstd-sys" 2007 | version = "1.6.3+zstd.1.5.2" 2008 | source = "registry+https://github.com/rust-lang/crates.io-index" 2009 | checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" 2010 | dependencies = [ 2011 | "cc", 2012 | "libc", 2013 | ] 2014 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bvm" 3 | version = "0.1.1" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | clap = { version = "3.2.16", features = ["derive"] } 10 | directories = "4.0.1" 11 | octocrab = "0.16.0" 12 | reqwest = { version = "0.11.11", features = ["stream"] } 13 | serde = "1.0.142" 14 | serde_derive = "1.0.142" 15 | tinytemplate = "1.2.1" 16 | zip = "0.6.2" 17 | indicatif = "0.15.0" 18 | futures-util = "0.3.21" 19 | bytes = "1.0.1" 20 | tokio = { version = "1.20.1", features = ["full"] } 21 | dialoguer = "0.10.2" 22 | regex = "1.6.0" 23 | semver = "1.0.13" 24 | 25 | [dependencies.uuid] 26 | version = "1.1.2" 27 | features = [ 28 | "v4", # Lets you generate random UUIDs 29 | "fast-rng", # Use a faster (but still sufficiently random) RNG 30 | "macro-diagnostics", # Enable better diagnostics for compile-time UUIDs 31 | ] 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 swz-git 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | _ 3 | | |____ ___ __ ___ 4 | | '_ \ \ / / '_ ` _ \ 5 | | |_) \ V /| | | | | | 6 | |_.__/ \_/ |_| |_| |_| 7 | 8 | fast bun version manager 9 | ``` 10 | 11 | Currently bvm only works on Linux but the plan is to support Windows and MacOS in the future as well. 12 | 13 | ## Install 14 | 15 | `cargo install --git https://github.com/swz-git/bvm` 16 | 17 | ## Shell setup 18 | 19 | add this to your `.bashrc` (or equivalent for your shell, `.zshrc` for zsh) 20 | 21 | `eval "$(bvm env)"` 22 | 23 | ## Help 24 | 25 | `bvm --help` or `bvm [SUBCOMMAND] --help` -------------------------------------------------------------------------------- /src/cmds/cmd_env.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | use tinytemplate::TinyTemplate; 3 | 4 | use crate::{utils::get_data_dir, Commands}; 5 | 6 | #[derive(Parser)] 7 | pub struct CliCommand {} 8 | 9 | pub fn match_and_run(commands: &Commands) { 10 | // You can check for the existence of subcommands, and if found use their 11 | // matches just as you would the top level cmd 12 | match commands { 13 | Commands::Env(cmd) => run(cmd), 14 | _ => {} 15 | }; 16 | } 17 | 18 | const ENV_SNIPPET: &str = include_str!("../snippets/env.sh"); 19 | 20 | #[derive(Serialize)] 21 | struct Context { 22 | data_dir: String, 23 | } 24 | 25 | fn run(_cmd: &CliCommand) { 26 | let mut tt = TinyTemplate::new(); 27 | tt.add_template("env_snippet", ENV_SNIPPET).unwrap(); 28 | 29 | let context = Context { 30 | data_dir: get_data_dir(), 31 | }; 32 | 33 | let rendered = tt.render("env_snippet", &context).unwrap(); 34 | print!("{}", rendered); 35 | } 36 | -------------------------------------------------------------------------------- /src/cmds/cmd_install.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | use std::{ 3 | env, 4 | fs::{self, create_dir_all}, 5 | io, 6 | os::unix::prelude::PermissionsExt, 7 | path::Path, 8 | }; 9 | 10 | use crate::{ 11 | utils::{download_with_progress, get_data_dir, parse_version_string}, 12 | Commands, 13 | }; 14 | 15 | #[derive(Parser)] 16 | pub struct CliCommand { 17 | /// Version to install 18 | /// ex. 0.1.6 or latest 19 | #[clap(value_parser)] 20 | version: String, 21 | 22 | /// Install even though already installed 23 | #[clap(short, long)] 24 | reinstall: bool, 25 | } 26 | 27 | pub async fn match_and_run(commands: &Commands) { 28 | // You can check for the existence of subcommands, and if found use their 29 | // matches just as you would the top level cmd 30 | match commands { 31 | Commands::Install(cmd) => run(cmd).await, 32 | _ => (), 33 | }; 34 | } 35 | 36 | async fn run(cmd: &CliCommand) { 37 | println!("Searching for a bun version containing {} 🔎", cmd.version); 38 | let octocrab = octocrab::instance(); 39 | let releases = octocrab 40 | .repos("oven-sh", "bun") 41 | .releases() 42 | .list() 43 | .per_page(100) 44 | .send() 45 | .await 46 | .expect("Error getting bun releases"); 47 | 48 | let release = match &*cmd.version { 49 | "latest" => releases 50 | .items 51 | .iter() 52 | .find(|x| x.tag_name.contains("bun-v")) 53 | .expect("Couldn't find latest release"), 54 | _ => releases 55 | .items 56 | .iter() 57 | .find(|x| { 58 | x.tag_name.starts_with( 59 | &(String::from("bun-v") + &*parse_version_string(&cmd.version, false)), 60 | ) 61 | }) // TODO: Fix better search, probably using starts_with 62 | .unwrap_or_else(|| panic!("Couldn't find a release containing {}", cmd.version)), 63 | }; 64 | 65 | println!("Found {} ✔", release.tag_name); 66 | 67 | let outdir = Path::new(&get_data_dir()).join(format!("versions/{}", release.tag_name)); 68 | let outpath = outdir.join("bun"); 69 | 70 | if outpath.exists() && !cmd.reinstall { 71 | println!( 72 | "This version of bun is already installed. Run with `--reinstall` flag to reinstall" 73 | ); 74 | return; 75 | } else if outpath.exists() { 76 | fs::remove_dir_all(&outdir).unwrap(); 77 | } 78 | 79 | let bun_os_name = match env::consts::OS { 80 | "linux" => "linux", 81 | "macos" => "darwin", 82 | _ => todo!("Platform {} not implemented yet", env::consts::OS), 83 | }; 84 | let bun_arch = match env::consts::ARCH { 85 | "x86_64" => "x64", 86 | _ => env::consts::ARCH, 87 | }; 88 | 89 | let download_link = &release 90 | .assets 91 | .iter() 92 | .find(|x| x.name == format!("bun-{}-{}.zip", bun_os_name, bun_arch)) 93 | .expect("Couldn't find release compatible with your system") 94 | .browser_download_url 95 | .as_str(); 96 | 97 | let zip_buf = download_with_progress(download_link).await; 98 | 99 | let zip_reader = std::io::Cursor::new(zip_buf); 100 | 101 | let mut zip = zip::ZipArchive::new(zip_reader).unwrap(); 102 | 103 | println!("Extracting..."); 104 | 105 | // Find bun file in zip and extract it to outdir 106 | let mut successful = false; 107 | for i in 0..zip.len() { 108 | let mut file = zip.by_index(i).unwrap(); 109 | if file.name().ends_with("/bun") { 110 | successful = true; 111 | // Make sure dir is created 112 | create_dir_all(&outdir) 113 | .expect("Installation failed, couldn't create install directory"); 114 | 115 | // Copy file from zip to install dir 116 | let mut outfile = fs::File::create(&outpath).unwrap(); 117 | io::copy(&mut file, &mut outfile).unwrap(); 118 | 119 | // Make file executable 120 | fs::set_permissions(&outpath, fs::Permissions::from_mode(0o755)).unwrap(); 121 | } 122 | } 123 | 124 | if !successful { 125 | panic!("Couldn't find bun executable in zip") 126 | } 127 | 128 | println!("Installed {}", release.tag_name); 129 | } 130 | -------------------------------------------------------------------------------- /src/cmds/cmd_list.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | 3 | use crate::{utils::get_available_versions, Commands}; 4 | 5 | #[derive(Parser)] 6 | pub struct CliCommand {} 7 | 8 | pub fn match_and_run(commands: &Commands) { 9 | // You can check for the existence of subcommands, and if found use their 10 | // matches just as you would the top level cmd 11 | match commands { 12 | Commands::List(cmd) => run(cmd), 13 | _ => {} 14 | }; 15 | } 16 | 17 | fn run(_cmd: &CliCommand) { 18 | println!("Installed versions:"); 19 | let versions = get_available_versions(false); 20 | for version in versions { 21 | println!("- {}", version) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/cmds/cmd_uninstall.rs: -------------------------------------------------------------------------------- 1 | use std::{fs, path::Path}; 2 | 3 | use clap::Parser; 4 | use dialoguer::Confirm; 5 | 6 | use crate::{utils::get_version_bin, Commands}; 7 | 8 | #[derive(Parser)] 9 | pub struct CliCommand { 10 | /// Version to uninstall 11 | /// ex. 0.1.6 or latest 12 | #[clap(value_parser)] 13 | version: String, 14 | } 15 | 16 | pub fn match_and_run(commands: &Commands) { 17 | // You can check for the existence of subcommands, and if found use their 18 | // matches just as you would the top level cmd 19 | match commands { 20 | Commands::Uninstall(cmd) => run(cmd), 21 | _ => {} 22 | }; 23 | } 24 | 25 | fn run(cmd: &CliCommand) { 26 | let bin = get_version_bin(&cmd.version, true) 27 | .expect("Couldn't find that version installed using bvm"); 28 | let dir = Path::new(&bin).parent().unwrap(); 29 | let dirname = dir.file_name().unwrap().to_str().unwrap(); 30 | let doit = Confirm::new() 31 | .with_prompt(format!("Are you sure you want to uninstall {}", dirname)) 32 | .interact() 33 | .unwrap(); 34 | if doit { 35 | fs::remove_dir_all(dir).unwrap(); 36 | println!("Removed {}", dirname) 37 | } else { 38 | println!("Did not remove {}", dirname) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/cmds/cmd_use.rs: -------------------------------------------------------------------------------- 1 | use std::{env, fs, path::Path}; 2 | 3 | use clap::Parser; 4 | 5 | use crate::{ 6 | utils::{get_current_version, get_data_dir, get_version_bin, parse_version_string}, 7 | Commands, 8 | }; 9 | 10 | #[derive(Parser)] 11 | pub struct CliCommand { 12 | #[clap(value_parser)] 13 | /// Version to use (global) 14 | version: Option, 15 | } 16 | 17 | pub fn match_and_run(commands: &Commands) { 18 | // You can check for the existence of subcommands, and if found use their 19 | // matches just as you would the top level cmd 20 | match commands { 21 | Commands::Use(cmd) => run(cmd), 22 | _ => {} 23 | }; 24 | } 25 | 26 | fn print_version(symlink_path: &Path) { 27 | let version = get_current_version(symlink_path); 28 | if version.is_none() { 29 | println!("No version of bun is activated using bvm."); 30 | } else { 31 | println!("Using bun version {}", version.unwrap()); 32 | } 33 | } 34 | 35 | fn run(cmd: &CliCommand) { 36 | if env::var("BVM_ACTIVATED").unwrap_or(String::from("")) != "1" { 37 | println!("WARNING: You haven't added `eval \"$(bvm env)\"` to your shell init yet, you won't be able to use bun through bvm.\n") 38 | } 39 | let symlink_dir = Path::new(&get_data_dir()).join("bin"); 40 | let symlink_pathbuf = Path::new(&get_data_dir()).join("bin/bun"); 41 | let symlink_path = symlink_pathbuf.as_path(); 42 | match &cmd.version { 43 | None => { 44 | print_version(symlink_path); 45 | return; 46 | } 47 | _ => {} 48 | } 49 | let bin = get_version_bin(&cmd.version.as_ref().unwrap(), false).expect(&*format!( 50 | "Couldn't find version installed: {}", 51 | parse_version_string(&cmd.version.as_ref().unwrap(), false) 52 | )); 53 | if !symlink_dir.exists() { 54 | fs::create_dir_all(symlink_dir).unwrap(); 55 | } 56 | if symlink_path.exists() && symlink_path.is_symlink() { 57 | fs::remove_file(symlink_path).unwrap(); 58 | } 59 | std::os::unix::fs::symlink(&bin, symlink_path).expect("Failed to create symlink"); 60 | 61 | print_version(symlink_path); 62 | } 63 | -------------------------------------------------------------------------------- /src/cmds/example.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | 3 | use crate::Commands; 4 | 5 | #[derive(Parser)] 6 | pub struct CliCommand {} 7 | 8 | pub fn match_and_run(commands: &Commands) { 9 | // You can check for the existence of subcommands, and if found use their 10 | // matches just as you would the top level cmd 11 | match commands { 12 | Commands::EXAMPLE(cmd) => run(cmd), 13 | _ => {} 14 | }; 15 | } 16 | 17 | fn run(cmd: &CliCommand) { 18 | // code here 19 | } 20 | -------------------------------------------------------------------------------- /src/cmds/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod cmd_env; 2 | pub mod cmd_install; 3 | pub mod cmd_list; 4 | pub mod cmd_uninstall; 5 | pub mod cmd_use; 6 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate serde_derive; 3 | extern crate tinytemplate; 4 | 5 | use clap::{Parser, Subcommand}; 6 | use std::env; 7 | 8 | mod cmds; 9 | pub mod utils; 10 | 11 | #[derive(Parser)] 12 | #[clap(author, version, about, long_about = None)] 13 | #[clap(propagate_version = true)] 14 | struct Cli { 15 | #[clap(subcommand)] 16 | command: Commands, 17 | } 18 | 19 | #[derive(Subcommand)] 20 | pub enum Commands { 21 | /// Install a bun version 22 | Install(cmds::cmd_install::CliCommand), 23 | /// Choose a bun version to use (global) 24 | Use(cmds::cmd_use::CliCommand), 25 | /// Print required environment variables 26 | Env(cmds::cmd_env::CliCommand), 27 | /// List all versions installed 28 | List(cmds::cmd_list::CliCommand), 29 | /// Uninstall a bun version 30 | Uninstall(cmds::cmd_uninstall::CliCommand), 31 | } 32 | 33 | #[tokio::main] 34 | async fn main() { 35 | if env::consts::OS != "linux" { 36 | panic!("This program is only supported on Linux, other OSs are planned"); 37 | } 38 | let cli = Cli::parse(); 39 | 40 | cmds::cmd_install::match_and_run(&cli.command).await; 41 | cmds::cmd_use::match_and_run(&cli.command); 42 | cmds::cmd_env::match_and_run(&cli.command); 43 | cmds::cmd_list::match_and_run(&cli.command); 44 | cmds::cmd_uninstall::match_and_run(&cli.command); 45 | } 46 | -------------------------------------------------------------------------------- /src/snippets/env.sh: -------------------------------------------------------------------------------- 1 | export PATH="{data_dir}/bin":$PATH 2 | export BVM_ACTIVATED=1 -------------------------------------------------------------------------------- /src/utils.rs: -------------------------------------------------------------------------------- 1 | use std::{cmp::min, path::Path}; 2 | 3 | use bytes::Bytes; 4 | use directories::BaseDirs; 5 | use futures_util::StreamExt; 6 | use indicatif::{ProgressBar, ProgressStyle}; 7 | use regex::Regex; 8 | 9 | pub fn get_data_dir() -> String { 10 | if let Some(base_dirs) = BaseDirs::new() { 11 | // TODO swz: Fix this ugly mess 12 | return String::from(base_dirs.data_dir().join("bvm").to_str().unwrap()); 13 | } else { 14 | panic!("Couldn't get base directories") 15 | }; 16 | } 17 | 18 | pub fn semver_sort(versions: Vec) -> Vec { 19 | let parsed_versions: Vec = versions 20 | .iter() 21 | .map(|v| parse_version_string(v, true)) 22 | .collect(); 23 | 24 | let mut semversions: Vec = parsed_versions 25 | .iter() 26 | .map(|v| semver::Version::parse(v).expect("Invalid semver version, cant't sort")) 27 | .collect(); 28 | 29 | semversions.sort(); 30 | 31 | semversions.iter().map(|v| v.to_string()).collect() 32 | } 33 | 34 | // takes "bun-v1.2", "v1.12.0" and "6" and returns "1.2.0", "1.12.0" and "6.0.0" 35 | pub fn parse_version_string(version: &str, fill_empty: bool) -> String { 36 | let re = Regex::new(r"^(bun-v|v)?(?P\d+(\.\d+)*)$").unwrap(); 37 | let version_matches = re 38 | .captures(version) 39 | .expect(&*format!("Invalid version string: {}", version)); 40 | 41 | let versionstr = &version_matches["version"]; 42 | let mut versionsplit: Vec<&str> = versionstr.split(".").collect(); 43 | 44 | if fill_empty { 45 | for _ in 0..3 - versionsplit.len().min(3) { 46 | versionsplit.push("0"); 47 | } 48 | } 49 | 50 | versionsplit.join(".") 51 | } 52 | 53 | // TODO: Messy function 54 | /// Gets path of version (if multiple matches, sort by highest version) 55 | pub fn get_version_bin(version: &str, only_bvm: bool) -> Option { 56 | let bvm_version_list = get_available_versions(true); 57 | let bvm_version: String = semver_sort(bvm_version_list) 58 | .iter() 59 | .rev() 60 | .find(|x| x.starts_with(&parse_version_string(version, false))) 61 | .unwrap_or(&String::from("NOTFOUND")) 62 | .to_string(); 63 | if bvm_version == String::from("NOTFOUND") { 64 | if only_bvm { 65 | return None; 66 | } 67 | let bun_bin_path = match version { 68 | "package-manager" => Path::new("/usr/bin/bun"), 69 | "system" => Path::new("$HOME/.bun/bin/bun"), 70 | _ => return None, 71 | }; 72 | if bun_bin_path.exists() && bun_bin_path.is_file() { 73 | return Some(String::from(bun_bin_path.to_str().unwrap())); 74 | } else { 75 | return None; 76 | }; 77 | } else { 78 | let data_dir = get_data_dir(); 79 | let bun_bin_path_string = String::from( 80 | Path::new(Path::new(&*data_dir)) 81 | .join(format!("versions/bun-v{}/bun", bvm_version)) 82 | .to_str() 83 | .unwrap(), 84 | ); 85 | let bun_bin_path = Path::new(&*bun_bin_path_string); 86 | if bun_bin_path.exists() && bun_bin_path.is_file() { 87 | return Some(String::from(bun_bin_path.to_str().unwrap())); 88 | } else { 89 | return None; 90 | }; 91 | } 92 | } 93 | 94 | // TODO swz: Should probably clean this function up, its pretty messy 95 | pub fn get_available_versions(only_bvm: bool) -> Vec { 96 | let mut versions: Vec = vec![]; 97 | let mut to_check: Vec = vec![]; 98 | 99 | struct Version { 100 | name: String, 101 | path: String, 102 | } 103 | 104 | for path in Path::new(&get_data_dir()) 105 | .join("versions") 106 | .read_dir() 107 | .expect("Error reading versions") 108 | { 109 | let bunpath = path.as_ref().unwrap().path().join("bun"); 110 | let dirname = path.as_ref().unwrap().file_name(); 111 | to_check.push(Version { 112 | name: String::from(dirname.to_str().unwrap()), 113 | path: String::from(bunpath.to_str().unwrap()), 114 | }) 115 | } 116 | 117 | for path in to_check.iter() { 118 | if Path::new(&path.path).is_file() { 119 | versions.push(path.name.clone()) 120 | } 121 | } 122 | 123 | versions = semver_sort( 124 | versions 125 | .iter() 126 | .map(|x| { 127 | if x == "package-manager" || x == "system" { 128 | x.clone() 129 | } else { 130 | parse_version_string(x, true) 131 | } 132 | }) 133 | .collect(), 134 | ); 135 | 136 | if !only_bvm { 137 | let mut sys_check: Vec = vec![]; 138 | sys_check.push(Version { 139 | name: "package-manager".to_owned(), 140 | path: String::from(Path::new("/usr/bin/bun").to_str().unwrap()), 141 | }); 142 | sys_check.push(Version { 143 | name: "system".to_owned(), 144 | path: String::from(Path::new("$HOME/.bun/bin/bun").to_str().unwrap()), 145 | }); 146 | for path in sys_check.iter() { 147 | if Path::new(&path.path).is_file() { 148 | versions.push(path.name.clone()) 149 | } 150 | } 151 | }; 152 | 153 | versions 154 | } 155 | 156 | pub async fn download_with_progress(url: &str) -> bytes::Bytes { 157 | let client = reqwest::Client::new(); 158 | // Reqwest setup 159 | let res = client 160 | .get(url) 161 | .send() 162 | .await 163 | .unwrap_or_else(|_| panic!("Failed to GET from '{}'", &url)); 164 | let total_size = res 165 | .content_length() 166 | .unwrap_or_else(|| panic!("Failed to get content length from '{}'", &url)); 167 | 168 | // Indicatif setup 169 | let pb = ProgressBar::new(total_size); 170 | pb.set_style(ProgressStyle::default_bar() 171 | .template("{msg}\n{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({bytes_per_sec}, {eta})") 172 | .progress_chars("#>-")); 173 | pb.set_message(&format!("Downloading {}", url)); 174 | 175 | // download chunks 176 | let mut downloaded: u64 = 0; 177 | let mut stream = res.bytes_stream(); 178 | let mut resulting: Bytes = Bytes::new(); 179 | 180 | while let Some(item) = stream.next().await { 181 | let chunk = item.expect("Error while downloading file"); 182 | resulting = Bytes::from([resulting, chunk.clone()].concat()); 183 | let new = min(downloaded + (chunk.len() as u64), total_size); 184 | downloaded = new; 185 | pb.set_position(new); 186 | } 187 | 188 | pb.finish_with_message(&format!("Downloaded {}", url)); 189 | resulting 190 | } 191 | 192 | pub fn get_current_version(symlink_path: &Path) -> Option { 193 | if !symlink_path.exists() { 194 | return None; 195 | } else { 196 | let actual = symlink_path 197 | .read_link() 198 | .expect("Symlink path didn't contain symlink"); 199 | let version = actual 200 | .parent() 201 | .unwrap() 202 | .file_name() 203 | .unwrap() 204 | .to_str() 205 | .unwrap(); 206 | return Some(parse_version_string(version, true)); 207 | } 208 | } 209 | --------------------------------------------------------------------------------