Compare commits
10 Commits
fc4266bf67
...
v0.6.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 92092ed4af | |||
| fadf687a3e | |||
| 3a18870537 | |||
| cf80678ccc | |||
| 08ce4b6add | |||
| 39075a6269 | |||
| 906ead80a4 | |||
| 7038661296 | |||
| 543bf94a51 | |||
| 453f73c2a0 |
492
Cargo.lock
generated
492
Cargo.lock
generated
@@ -11,17 +11,6 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-channel"
|
|
||||||
version = "1.6.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319"
|
|
||||||
dependencies = [
|
|
||||||
"concurrent-queue",
|
|
||||||
"event-listener",
|
|
||||||
"futures-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "atty"
|
||||||
version = "0.2.14"
|
version = "0.2.14"
|
||||||
@@ -35,9 +24,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.0.1"
|
version = "1.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
@@ -45,29 +34,11 @@ version = "1.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bytes"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cache-padded"
|
|
||||||
version = "1.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "castaway"
|
|
||||||
version = "0.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.72"
|
version = "1.0.73"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
|
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
]
|
]
|
||||||
@@ -80,9 +51,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.0.10"
|
version = "3.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a30c3bf9ff12dfe5dae53f0a96e0febcd18420d1c0e7fad77796d9d5c4b5375"
|
checksum = "6d76c22c9b9b215eeb8d016ad3a90417bd13cb24cf8142756e6472445876cab7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
@@ -97,9 +68,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "3.0.6"
|
version = "3.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "517358c28fcef6607bf6f76108e02afad7e82297d132a6b846dcc1fc3efcd153"
|
checksum = "5fd1122e63869df2cb309f449da1ad54a7c6dfeb7c7e6ccd8e0825d9eb93bb72"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.4.0",
|
"heck 0.4.0",
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
@@ -110,9 +81,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "comfy-table"
|
name = "comfy-table"
|
||||||
version = "5.0.0"
|
version = "5.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c42350b81f044f576ff88ac750419f914abb46a03831bb1747134344ee7a4e64"
|
checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"strum",
|
"strum",
|
||||||
@@ -120,15 +91,6 @@ dependencies = [
|
|||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "concurrent-queue"
|
|
||||||
version = "1.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3"
|
|
||||||
dependencies = [
|
|
||||||
"cache-padded",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console"
|
name = "console"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
@@ -144,21 +106,11 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crossbeam-utils"
|
|
||||||
version = "0.8.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossterm"
|
name = "crossterm"
|
||||||
version = "0.22.1"
|
version = "0.23.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c85525306c4291d1b73ce93c8acf9c339f9b213aef6c1d85c3830cbf1c16325c"
|
checksum = "77b75a27dc8d220f1f8521ea69cd55a34d720a200ebb3a624d9aa19193d3b432"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"crossterm_winapi",
|
"crossterm_winapi",
|
||||||
@@ -179,37 +131,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "curl"
|
|
||||||
version = "0.4.42"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7de97b894edd5b5bcceef8b78d7da9b75b1d2f2f9a910569d0bde3dd31d84939"
|
|
||||||
dependencies = [
|
|
||||||
"curl-sys",
|
|
||||||
"libc",
|
|
||||||
"openssl-probe",
|
|
||||||
"openssl-sys",
|
|
||||||
"schannel",
|
|
||||||
"socket2",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "curl-sys"
|
|
||||||
version = "0.4.52+curl-7.81.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "14b8c2d1023ea5fded5b7b892e4b8e95f70038a421126a056761a84246a28971"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
"libnghttp2-sys",
|
|
||||||
"libz-sys",
|
|
||||||
"openssl-sys",
|
|
||||||
"pkg-config",
|
|
||||||
"vcpkg",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dirs-next"
|
name = "dirs-next"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
@@ -237,36 +158,6 @@ version = "0.3.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
|
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "encoding_rs"
|
|
||||||
version = "0.8.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "event-listener"
|
|
||||||
version = "2.5.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fastrand"
|
|
||||||
version = "1.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
|
|
||||||
dependencies = [
|
|
||||||
"instant",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fnv"
|
|
||||||
version = "1.0.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "form_urlencoded"
|
name = "form_urlencoded"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@@ -283,33 +174,6 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-core"
|
|
||||||
version = "0.3.19"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-io"
|
|
||||||
version = "0.3.19"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-lite"
|
|
||||||
version = "1.12.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48"
|
|
||||||
dependencies = [
|
|
||||||
"fastrand",
|
|
||||||
"futures-core",
|
|
||||||
"futures-io",
|
|
||||||
"memchr",
|
|
||||||
"parking",
|
|
||||||
"pin-project-lite",
|
|
||||||
"waker-fn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
@@ -323,17 +187,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git-repo-manager"
|
name = "git-repo-manager"
|
||||||
version = "0.6.0"
|
version = "0.6.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"comfy-table",
|
"comfy-table",
|
||||||
"console",
|
"console",
|
||||||
"git2",
|
"git2",
|
||||||
"isahc",
|
|
||||||
"parse_link_header",
|
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
"tempdir",
|
"tempdir",
|
||||||
@@ -385,17 +246,6 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "http"
|
|
||||||
version = "0.2.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03"
|
|
||||||
dependencies = [
|
|
||||||
"bytes",
|
|
||||||
"fnv",
|
|
||||||
"itoa",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
@@ -417,50 +267,6 @@ dependencies = [
|
|||||||
"hashbrown",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "instant"
|
|
||||||
version = "0.1.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "isahc"
|
|
||||||
version = "1.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d140e84730d325378912ede32d7cd53ef1542725503b3353e5ec8113c7c6f588"
|
|
||||||
dependencies = [
|
|
||||||
"async-channel",
|
|
||||||
"castaway",
|
|
||||||
"crossbeam-utils",
|
|
||||||
"curl",
|
|
||||||
"curl-sys",
|
|
||||||
"encoding_rs",
|
|
||||||
"event-listener",
|
|
||||||
"futures-lite",
|
|
||||||
"http",
|
|
||||||
"log",
|
|
||||||
"mime",
|
|
||||||
"once_cell",
|
|
||||||
"polling",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"slab",
|
|
||||||
"sluice",
|
|
||||||
"tracing",
|
|
||||||
"tracing-futures",
|
|
||||||
"url",
|
|
||||||
"waker-fn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "itoa"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jobserver"
|
name = "jobserver"
|
||||||
version = "0.1.24"
|
version = "0.1.24"
|
||||||
@@ -478,9 +284,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.113"
|
version = "0.2.119"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9"
|
checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
@@ -496,16 +302,6 @@ dependencies = [
|
|||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libnghttp2-sys"
|
|
||||||
version = "0.1.7+1.45.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libssh2-sys"
|
name = "libssh2-sys"
|
||||||
version = "0.2.23"
|
version = "0.2.23"
|
||||||
@@ -540,9 +336,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.4.5"
|
version = "0.4.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
|
checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"scopeguard",
|
"scopeguard",
|
||||||
]
|
]
|
||||||
@@ -568,12 +364,6 @@ version = "2.4.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "mime"
|
|
||||||
version = "0.3.16"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mio"
|
name = "mio"
|
||||||
version = "0.7.14"
|
version = "0.7.14"
|
||||||
@@ -598,9 +388,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ntapi"
|
name = "ntapi"
|
||||||
version = "0.3.6"
|
version = "0.3.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
|
checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
@@ -639,46 +429,27 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking"
|
|
||||||
version = "2.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.11.2"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"instant",
|
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"parking_lot_core",
|
"parking_lot_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.8.5"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
|
checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"instant",
|
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"winapi",
|
"windows-sys",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parse_link_header"
|
|
||||||
version = "0.3.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "40728c9c01de984c45f49385ab054fdc31cd3322658a6934347887e72cb48df9"
|
|
||||||
dependencies = [
|
|
||||||
"http",
|
|
||||||
"lazy_static",
|
|
||||||
"regex",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -687,51 +458,12 @@ version = "2.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pin-project"
|
|
||||||
version = "1.0.10"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e"
|
|
||||||
dependencies = [
|
|
||||||
"pin-project-internal",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pin-project-internal"
|
|
||||||
version = "1.0.10"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pin-project-lite"
|
|
||||||
version = "0.2.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.24"
|
version = "0.3.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
|
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "polling"
|
|
||||||
version = "2.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
"log",
|
|
||||||
"wepoll-ffi",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-error"
|
name = "proc-macro-error"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -856,22 +588,18 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.9"
|
version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
|
checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "schannel"
|
|
||||||
version = "0.1.19"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75"
|
|
||||||
dependencies = [
|
|
||||||
"lazy_static",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
@@ -880,35 +608,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.135"
|
version = "1.0.136"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2cf9235533494ea2ddcdb794665461814781c53f19d87b76e571a1c35acbad2b"
|
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.135"
|
version = "1.0.136"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8dcde03d87d4c973c04be249e7d8f0b35db1c848c487bd43032808e59dd8328d"
|
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "serde_json"
|
|
||||||
version = "1.0.78"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
|
|
||||||
dependencies = [
|
|
||||||
"itoa",
|
|
||||||
"ryu",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_yaml"
|
name = "serde_yaml"
|
||||||
version = "0.8.23"
|
version = "0.8.23"
|
||||||
@@ -960,39 +677,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "slab"
|
|
||||||
version = "0.4.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sluice"
|
|
||||||
version = "0.5.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5"
|
|
||||||
dependencies = [
|
|
||||||
"async-channel",
|
|
||||||
"futures-core",
|
|
||||||
"futures-io",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
version = "1.8.0"
|
version = "1.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
|
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "socket2"
|
|
||||||
version = "0.4.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0f82496b90c36d70af5fcd482edaa2e0bd16fade569de1330405fecbbdac736b"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
@@ -1001,19 +691,20 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strum"
|
name = "strum"
|
||||||
version = "0.22.0"
|
version = "0.23.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e"
|
checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strum_macros"
|
name = "strum_macros"
|
||||||
version = "0.22.0"
|
version = "0.23.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb"
|
checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.3.3",
|
"heck 0.3.3",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
"rustversion",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1087,49 +778,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing"
|
|
||||||
version = "0.1.29"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"log",
|
|
||||||
"pin-project-lite",
|
|
||||||
"tracing-attributes",
|
|
||||||
"tracing-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-attributes"
|
|
||||||
version = "0.1.18"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-core"
|
|
||||||
version = "0.1.21"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
|
|
||||||
dependencies = [
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-futures"
|
|
||||||
version = "0.2.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
|
|
||||||
dependencies = [
|
|
||||||
"pin-project",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-bidi"
|
name = "unicode-bidi"
|
||||||
version = "0.3.7"
|
version = "0.3.7"
|
||||||
@@ -1147,9 +795,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.8.0"
|
version = "1.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
|
checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
@@ -1187,27 +835,12 @@ version = "0.9.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "waker-fn"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
version = "0.10.2+wasi-snapshot-preview1"
|
version = "0.10.2+wasi-snapshot-preview1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wepoll-ffi"
|
|
||||||
version = "0.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
version = "0.3.9"
|
version = "0.3.9"
|
||||||
@@ -1239,6 +872,49 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yaml-rust"
|
name = "yaml-rust"
|
||||||
version = "0.4.5"
|
version = "0.4.5"
|
||||||
|
|||||||
18
Cargo.toml
18
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "git-repo-manager"
|
name = "git-repo-manager"
|
||||||
version = "0.6.0"
|
version = "0.6.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [
|
authors = [
|
||||||
"Hannes Körber <hannes@hkoerber.de>",
|
"Hannes Körber <hannes@hkoerber.de>",
|
||||||
@@ -40,7 +40,7 @@ path = "src/grm/main.rs"
|
|||||||
version = "=0.5.8"
|
version = "=0.5.8"
|
||||||
|
|
||||||
[dependencies.serde]
|
[dependencies.serde]
|
||||||
version = "=1.0.135"
|
version = "=1.0.136"
|
||||||
features = ["derive"]
|
features = ["derive"]
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
@@ -50,7 +50,7 @@ version = "=0.13.25"
|
|||||||
version = "=2.1.0"
|
version = "=2.1.0"
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
version = "=3.0.10"
|
version = "=3.1.1"
|
||||||
features = ["derive", "cargo"]
|
features = ["derive", "cargo"]
|
||||||
|
|
||||||
[dependencies.console]
|
[dependencies.console]
|
||||||
@@ -60,20 +60,10 @@ version = "=0.15.0"
|
|||||||
version = "=1.5.4"
|
version = "=1.5.4"
|
||||||
|
|
||||||
[dependencies.comfy-table]
|
[dependencies.comfy-table]
|
||||||
version = "=5.0.0"
|
version = "=5.0.1"
|
||||||
|
|
||||||
[dependencies.serde_yaml]
|
[dependencies.serde_yaml]
|
||||||
version = "=0.8.23"
|
version = "=0.8.23"
|
||||||
|
|
||||||
[dependencies.serde_json]
|
|
||||||
version = "=1.0.78"
|
|
||||||
|
|
||||||
[dependencies.isahc]
|
|
||||||
version = "=1.6.0"
|
|
||||||
features = ["json"]
|
|
||||||
|
|
||||||
[dependencies.parse_link_header]
|
|
||||||
version = "=0.3.2"
|
|
||||||
|
|
||||||
[dev-dependencies.tempdir]
|
[dev-dependencies.tempdir]
|
||||||
version = "=0.3.7"
|
version = "=0.3.7"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
attrs==21.4.0
|
attrs==21.4.0
|
||||||
gitdb==4.0.9
|
gitdb==4.0.9
|
||||||
GitPython==3.1.26
|
GitPython==3.1.27
|
||||||
iniconfig==1.1.1
|
iniconfig==1.1.1
|
||||||
packaging==21.3
|
packaging==21.3
|
||||||
pluggy==1.0.0
|
pluggy==1.0.0
|
||||||
py==1.11.0
|
py==1.11.0
|
||||||
pyparsing==3.0.7
|
pyparsing==3.0.7
|
||||||
pytest==6.2.5
|
pytest==7.0.1
|
||||||
PyYAML==6.0
|
PyYAML==6.0
|
||||||
smmap==5.0.0
|
smmap==5.0.0
|
||||||
toml==0.10.2
|
toml==0.10.2
|
||||||
typing_extensions==4.0.1
|
tomli==2.0.1
|
||||||
|
typing_extensions==4.1.1
|
||||||
|
|||||||
139
src/grm/cmd.rs
139
src/grm/cmd.rs
@@ -31,94 +31,20 @@ pub struct Repos {
|
|||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
pub enum ReposAction {
|
pub enum ReposAction {
|
||||||
#[clap(subcommand)]
|
#[clap(
|
||||||
Sync(SyncAction),
|
visible_alias = "run",
|
||||||
#[clap(subcommand)]
|
about = "Synchronize the repositories to the configured values"
|
||||||
Find(FindAction),
|
)]
|
||||||
|
Sync(Sync),
|
||||||
|
#[clap(about = "Generate a repository configuration from an existing file tree")]
|
||||||
|
Find(Find),
|
||||||
#[clap(about = "Show status of configured repositories")]
|
#[clap(about = "Show status of configured repositories")]
|
||||||
Status(OptionalConfig),
|
Status(OptionalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
|
||||||
#[clap(about = "Sync local repositories with a configured list")]
|
|
||||||
pub enum SyncAction {
|
|
||||||
#[clap(
|
|
||||||
visible_alias = "run",
|
|
||||||
about = "Synchronize the repositories to the configured values"
|
|
||||||
)]
|
|
||||||
Config(Config),
|
|
||||||
#[clap(about = "Synchronize the repositories from a remote provider")]
|
|
||||||
Remote(Remote),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
|
||||||
#[clap(about = "Generate a repository configuration from existing repositories")]
|
|
||||||
pub enum FindAction {
|
|
||||||
#[clap(about = "Find local repositories")]
|
|
||||||
Local(FindLocalArgs),
|
|
||||||
#[clap(about = "Find repositories on remote provider")]
|
|
||||||
Remote(FindRemoteArgs),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
|
||||||
pub struct FindLocalArgs {
|
|
||||||
#[clap(help = "The path to search through")]
|
|
||||||
pub path: String,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
arg_enum,
|
|
||||||
short,
|
|
||||||
long,
|
|
||||||
help = "Format to produce",
|
|
||||||
default_value_t = ConfigFormat::Toml,
|
|
||||||
)]
|
|
||||||
pub format: ConfigFormat,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[clap()]
|
#[clap()]
|
||||||
pub struct FindRemoteArgs {
|
pub struct Sync {
|
||||||
#[clap(arg_enum, short, long, help = "Remote provider to use")]
|
|
||||||
pub provider: RemoteProvider,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
multiple_occurrences = true,
|
|
||||||
name = "user",
|
|
||||||
long,
|
|
||||||
help = "Users to get repositories from"
|
|
||||||
)]
|
|
||||||
pub users: Vec<String>,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
multiple_occurrences = true,
|
|
||||||
name = "group",
|
|
||||||
long,
|
|
||||||
help = "Groups to get repositories from"
|
|
||||||
)]
|
|
||||||
pub groups: Vec<String>,
|
|
||||||
|
|
||||||
#[clap(long, help = "Get repositories that belong to the requesting user")]
|
|
||||||
pub owner: bool,
|
|
||||||
|
|
||||||
#[clap(long, help = "Command to get API token")]
|
|
||||||
pub token_command: String,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
arg_enum,
|
|
||||||
short,
|
|
||||||
long,
|
|
||||||
help = "Format to produce",
|
|
||||||
default_value_t = ConfigFormat::Toml,
|
|
||||||
)]
|
|
||||||
pub format: ConfigFormat,
|
|
||||||
|
|
||||||
#[clap(long, help = "Root of the repo tree to produce")]
|
|
||||||
pub root: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
|
||||||
#[clap()]
|
|
||||||
pub struct Config {
|
|
||||||
#[clap(
|
#[clap(
|
||||||
short,
|
short,
|
||||||
long,
|
long,
|
||||||
@@ -128,40 +54,6 @@ pub struct Config {
|
|||||||
pub config: String,
|
pub config: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(clap::ArgEnum, Clone)]
|
|
||||||
pub enum RemoteProvider {
|
|
||||||
Github,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
|
||||||
#[clap()]
|
|
||||||
pub struct Remote {
|
|
||||||
#[clap(arg_enum, short, long, help = "Remote provider to use")]
|
|
||||||
pub provider: RemoteProvider,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
multiple_occurrences = true,
|
|
||||||
name = "user",
|
|
||||||
long,
|
|
||||||
help = "Users to get repositories from"
|
|
||||||
)]
|
|
||||||
pub users: Vec<String>,
|
|
||||||
|
|
||||||
#[clap(
|
|
||||||
multiple_occurrences = true,
|
|
||||||
name = "group",
|
|
||||||
long,
|
|
||||||
help = "Groups to get repositories from"
|
|
||||||
)]
|
|
||||||
pub groups: Vec<String>,
|
|
||||||
|
|
||||||
#[clap(long, help = "Get repositories that belong to the requesting user")]
|
|
||||||
pub owner: bool,
|
|
||||||
|
|
||||||
#[clap(long, help = "Command to get API token")]
|
|
||||||
pub token_command: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[clap()]
|
#[clap()]
|
||||||
pub struct OptionalConfig {
|
pub struct OptionalConfig {
|
||||||
@@ -175,6 +67,21 @@ pub enum ConfigFormat {
|
|||||||
Toml,
|
Toml,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Parser)]
|
||||||
|
pub struct Find {
|
||||||
|
#[clap(help = "The path to search through")]
|
||||||
|
pub path: String,
|
||||||
|
|
||||||
|
#[clap(
|
||||||
|
arg_enum,
|
||||||
|
short,
|
||||||
|
long,
|
||||||
|
help = "Format to produce",
|
||||||
|
default_value_t = ConfigFormat::Toml,
|
||||||
|
)]
|
||||||
|
pub format: ConfigFormat,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
pub struct Worktree {
|
pub struct Worktree {
|
||||||
#[clap(subcommand, name = "action")]
|
#[clap(subcommand, name = "action")]
|
||||||
|
|||||||
327
src/grm/main.rs
327
src/grm/main.rs
@@ -5,7 +5,6 @@ mod cmd;
|
|||||||
|
|
||||||
use grm::config;
|
use grm::config;
|
||||||
use grm::output::*;
|
use grm::output::*;
|
||||||
use grm::provider::Provider;
|
|
||||||
use grm::repo;
|
use grm::repo;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -13,88 +12,26 @@ fn main() {
|
|||||||
|
|
||||||
match opts.subcmd {
|
match opts.subcmd {
|
||||||
cmd::SubCommand::Repos(repos) => match repos.action {
|
cmd::SubCommand::Repos(repos) => match repos.action {
|
||||||
cmd::ReposAction::Sync(sync) => match sync {
|
cmd::ReposAction::Sync(sync) => {
|
||||||
cmd::SyncAction::Config(args) => {
|
let config = match config::read_config(&sync.config) {
|
||||||
let config = match config::read_config(&args.config) {
|
Ok(config) => config,
|
||||||
Ok(config) => config,
|
Err(error) => {
|
||||||
Err(error) => {
|
print_error(&error);
|
||||||
print_error(&error);
|
process::exit(1);
|
||||||
process::exit(1);
|
}
|
||||||
}
|
};
|
||||||
};
|
match grm::sync_trees(config) {
|
||||||
match grm::sync_trees(config) {
|
Ok(success) => {
|
||||||
Ok(success) => {
|
if !success {
|
||||||
if !success {
|
process::exit(1)
|
||||||
process::exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!("Error syncing trees: {}", error));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
Err(error) => {
|
||||||
cmd::SyncAction::Remote(args) => {
|
print_error(&format!("Error syncing trees: {}", error));
|
||||||
let users = if args.users.is_empty() {
|
process::exit(1);
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(args.users)
|
|
||||||
};
|
|
||||||
|
|
||||||
let groups = if args.groups.is_empty() {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(args.groups)
|
|
||||||
};
|
|
||||||
|
|
||||||
let token_process = std::process::Command::new("/usr/bin/env")
|
|
||||||
.arg("sh")
|
|
||||||
.arg("-c")
|
|
||||||
.arg(args.token_command)
|
|
||||||
.output();
|
|
||||||
|
|
||||||
let token: String = match token_process {
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!("Failed to run token-command: {}", error));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
Ok(output) => {
|
|
||||||
let stderr = String::from_utf8(output.stderr).unwrap();
|
|
||||||
let stdout = String::from_utf8(output.stdout).unwrap();
|
|
||||||
|
|
||||||
if !output.status.success() {
|
|
||||||
if !stderr.is_empty() {
|
|
||||||
print_error(&format!("Token command failed: {}", stderr));
|
|
||||||
} else {
|
|
||||||
print_error("Token command failed.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !stderr.is_empty() {
|
|
||||||
print_error(&format!("Token command produced stderr: {}", stderr));
|
|
||||||
}
|
|
||||||
|
|
||||||
if stdout.is_empty() {
|
|
||||||
print_error("Token command did not produce output");
|
|
||||||
}
|
|
||||||
|
|
||||||
let token = stdout.split('\n').next().unwrap();
|
|
||||||
|
|
||||||
token.to_string()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let filter = grm::provider::Filter::new(users, groups, args.owner);
|
|
||||||
let github = grm::provider::Github::new(filter, token);
|
|
||||||
|
|
||||||
match github.get_repos() {
|
|
||||||
Ok(repos) => println!("{:?}", repos),
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!("Error: {}", error));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
cmd::ReposAction::Status(args) => match &args.config {
|
cmd::ReposAction::Status(args) => match &args.config {
|
||||||
Some(config_path) => {
|
Some(config_path) => {
|
||||||
let config = match config::read_config(config_path) {
|
let config = match config::read_config(config_path) {
|
||||||
@@ -142,187 +79,79 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cmd::ReposAction::Find(find) => match find {
|
cmd::ReposAction::Find(find) => {
|
||||||
cmd::FindAction::Local(args) => {
|
let path = Path::new(&find.path);
|
||||||
let path = Path::new(&args.path);
|
if !path.exists() {
|
||||||
if !path.exists() {
|
print_error(&format!("Path \"{}\" does not exist", path.display()));
|
||||||
print_error(&format!("Path \"{}\" does not exist", path.display()));
|
process::exit(1);
|
||||||
process::exit(1);
|
}
|
||||||
}
|
if !path.is_dir() {
|
||||||
if !path.is_dir() {
|
print_error(&format!("Path \"{}\" is not a directory", path.display()));
|
||||||
print_error(&format!("Path \"{}\" is not a directory", path.display()));
|
process::exit(1);
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
let path = match path.canonicalize() {
|
|
||||||
Ok(path) => path,
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!(
|
|
||||||
"Failed to canonicalize path \"{}\". This is a bug. Error message: {}",
|
|
||||||
&path.display(),
|
|
||||||
error
|
|
||||||
));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let (found_repos, warnings) = match grm::find_in_tree(&path) {
|
|
||||||
Ok((repos, warnings)) => (repos, warnings),
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&error);
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let trees = grm::config::Trees::from_vec(vec![found_repos]);
|
|
||||||
if trees.as_vec_ref().iter().all(|t| match &t.repos {
|
|
||||||
None => false,
|
|
||||||
Some(r) => r.is_empty(),
|
|
||||||
}) {
|
|
||||||
print_warning("No repositories found");
|
|
||||||
} else {
|
|
||||||
let config = trees.to_config();
|
|
||||||
|
|
||||||
match args.format {
|
|
||||||
cmd::ConfigFormat::Toml => {
|
|
||||||
let toml = match config.as_toml() {
|
|
||||||
Ok(toml) => toml,
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!(
|
|
||||||
"Failed converting config to TOML: {}",
|
|
||||||
&error
|
|
||||||
));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
print!("{}", toml);
|
|
||||||
}
|
|
||||||
cmd::ConfigFormat::Yaml => {
|
|
||||||
let yaml = match config.as_yaml() {
|
|
||||||
Ok(yaml) => yaml,
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!(
|
|
||||||
"Failed converting config to YAML: {}",
|
|
||||||
&error
|
|
||||||
));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
print!("{}", yaml);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for warning in warnings {
|
|
||||||
print_warning(&warning);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cmd::FindAction::Remote(args) => {
|
|
||||||
let users = if args.users.is_empty() {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(args.users)
|
|
||||||
};
|
|
||||||
|
|
||||||
let groups = if args.groups.is_empty() {
|
let path = match path.canonicalize() {
|
||||||
None
|
Ok(path) => path,
|
||||||
} else {
|
Err(error) => {
|
||||||
Some(args.groups)
|
print_error(&format!(
|
||||||
};
|
"Failed to canonicalize path \"{}\". This is a bug. Error message: {}",
|
||||||
|
&path.display(),
|
||||||
|
error
|
||||||
|
));
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let token_process = std::process::Command::new("/usr/bin/env")
|
let (found_repos, warnings) = match grm::find_in_tree(&path) {
|
||||||
.arg("sh")
|
Ok((repos, warnings)) => (repos, warnings),
|
||||||
.arg("-c")
|
Err(error) => {
|
||||||
.arg(args.token_command)
|
print_error(&error);
|
||||||
.output();
|
process::exit(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let token: String = match token_process {
|
let trees = grm::config::Trees::from_vec(vec![found_repos]);
|
||||||
Err(error) => {
|
if trees.as_vec_ref().iter().all(|t| match &t.repos {
|
||||||
print_error(&format!("Failed to run token-command: {}", error));
|
None => false,
|
||||||
process::exit(1);
|
Some(r) => r.is_empty(),
|
||||||
}
|
}) {
|
||||||
Ok(output) => {
|
print_warning("No repositories found");
|
||||||
let stderr = String::from_utf8(output.stderr).unwrap();
|
} else {
|
||||||
let stdout = String::from_utf8(output.stdout).unwrap();
|
let config = trees.to_config();
|
||||||
|
|
||||||
if !output.status.success() {
|
match find.format {
|
||||||
if !stderr.is_empty() {
|
cmd::ConfigFormat::Toml => {
|
||||||
print_error(&format!("Token command failed: {}", stderr));
|
let toml = match config.as_toml() {
|
||||||
} else {
|
Ok(toml) => toml,
|
||||||
print_error("Token command failed.");
|
Err(error) => {
|
||||||
|
print_error(&format!(
|
||||||
|
"Failed converting config to TOML: {}",
|
||||||
|
&error
|
||||||
|
));
|
||||||
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if !stderr.is_empty() {
|
|
||||||
print_error(&format!("Token command produced stderr: {}", stderr));
|
|
||||||
}
|
|
||||||
|
|
||||||
if stdout.is_empty() {
|
|
||||||
print_error("Token command did not produce output");
|
|
||||||
}
|
|
||||||
|
|
||||||
let token = stdout.split('\n').next().unwrap();
|
|
||||||
|
|
||||||
token.to_string()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let filter = grm::provider::Filter::new(users, groups, args.owner);
|
|
||||||
let github = grm::provider::Github::new(filter, token);
|
|
||||||
|
|
||||||
match github.get_repos() {
|
|
||||||
Ok(repos) => {
|
|
||||||
let mut trees: Vec<config::Tree> = vec![];
|
|
||||||
|
|
||||||
for (namespace, repolist) in repos {
|
|
||||||
let tree = config::Tree {
|
|
||||||
root: Path::new(&args.root)
|
|
||||||
.join(namespace)
|
|
||||||
.display()
|
|
||||||
.to_string(),
|
|
||||||
repos: Some(repolist),
|
|
||||||
};
|
|
||||||
trees.push(tree);
|
|
||||||
}
|
|
||||||
|
|
||||||
let config = config::Config {
|
|
||||||
trees: config::Trees::from_vec(trees),
|
|
||||||
};
|
};
|
||||||
|
print!("{}", toml);
|
||||||
match args.format {
|
|
||||||
cmd::ConfigFormat::Toml => {
|
|
||||||
let toml = match config.as_toml() {
|
|
||||||
Ok(toml) => toml,
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!(
|
|
||||||
"Failed converting config to TOML: {}",
|
|
||||||
&error
|
|
||||||
));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
print!("{}", toml);
|
|
||||||
}
|
|
||||||
cmd::ConfigFormat::Yaml => {
|
|
||||||
let yaml = match config.as_yaml() {
|
|
||||||
Ok(yaml) => yaml,
|
|
||||||
Err(error) => {
|
|
||||||
print_error(&format!(
|
|
||||||
"Failed converting config to YAML: {}",
|
|
||||||
&error
|
|
||||||
));
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
print!("{}", yaml);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Err(error) => {
|
cmd::ConfigFormat::Yaml => {
|
||||||
print_error(&format!("Error: {}", error));
|
let yaml = match config.as_yaml() {
|
||||||
process::exit(1);
|
Ok(yaml) => yaml,
|
||||||
|
Err(error) => {
|
||||||
|
print_error(&format!(
|
||||||
|
"Failed converting config to YAML: {}",
|
||||||
|
&error
|
||||||
|
));
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
print!("{}", yaml);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
for warning in warnings {
|
||||||
|
print_warning(&warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
cmd::SubCommand::Worktree(args) => {
|
cmd::SubCommand::Worktree(args) => {
|
||||||
let cwd = std::env::current_dir().unwrap_or_else(|error| {
|
let cwd = std::env::current_dir().unwrap_or_else(|error| {
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ use std::process;
|
|||||||
|
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod output;
|
pub mod output;
|
||||||
pub mod provider;
|
|
||||||
pub mod repo;
|
pub mod repo;
|
||||||
pub mod table;
|
pub mod table;
|
||||||
|
|
||||||
use config::{Config, Tree};
|
use config::{Config, Tree};
|
||||||
use output::*;
|
use output::*;
|
||||||
|
|
||||||
use repo::{clone_repo, detect_remote_type, Remote, RemoteType, RepoConfig};
|
use repo::{clone_repo, detect_remote_type, Remote, RepoConfig};
|
||||||
|
|
||||||
pub use repo::{RemoteTrackingStatus, Repo, RepoErrorKind, WorktreeRemoveFailureReason};
|
pub use repo::{RemoteTrackingStatus, Repo, RepoErrorKind, WorktreeRemoveFailureReason};
|
||||||
|
|
||||||
|
|||||||
@@ -1,199 +0,0 @@
|
|||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
use isahc::prelude::*;
|
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
use crate::{Remote, RemoteType, RepoConfig};
|
|
||||||
|
|
||||||
use super::Filter;
|
|
||||||
use super::Provider;
|
|
||||||
use super::SecretToken;
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
#[serde(untagged)]
|
|
||||||
enum GithubUserProjectResponse {
|
|
||||||
Success(Vec<GithubProject>),
|
|
||||||
Failure(GithubFailureResponse),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct GithubProject {
|
|
||||||
pub name: String,
|
|
||||||
pub full_name: String,
|
|
||||||
pub clone_url: String,
|
|
||||||
pub ssh_url: String,
|
|
||||||
pub private: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl GithubProject {
|
|
||||||
fn into_repo_config(self) -> RepoConfig {
|
|
||||||
RepoConfig {
|
|
||||||
name: self.name,
|
|
||||||
worktree_setup: false,
|
|
||||||
remotes: Some(vec![Remote {
|
|
||||||
name: String::from("github"),
|
|
||||||
url: match self.private {
|
|
||||||
true => self.ssh_url,
|
|
||||||
false => self.clone_url,
|
|
||||||
},
|
|
||||||
remote_type: match self.private {
|
|
||||||
true => RemoteType::Ssh,
|
|
||||||
false => RemoteType::Https,
|
|
||||||
},
|
|
||||||
}]),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct GithubFailureResponse {
|
|
||||||
pub message: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Github {
|
|
||||||
filter: Filter,
|
|
||||||
secret_token: SecretToken,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Github {
|
|
||||||
fn get_repo_list_from_uri(
|
|
||||||
uri: &str,
|
|
||||||
secret_token: &SecretToken,
|
|
||||||
) -> Result<Vec<(String, GithubProject)>, String> {
|
|
||||||
let mut repos: Vec<(String, GithubProject)> = vec![];
|
|
||||||
|
|
||||||
let client = isahc::HttpClient::new().map_err(|error| error.to_string())?;
|
|
||||||
|
|
||||||
let request = isahc::Request::builder()
|
|
||||||
.uri(uri)
|
|
||||||
.header("accept", " application/vnd.github.v3+json")
|
|
||||||
.header("authorization", format!("token {}", secret_token))
|
|
||||||
.body(())
|
|
||||||
.map_err(|error| error.to_string())?;
|
|
||||||
|
|
||||||
let mut response = client.send(request).map_err(|error| error.to_string())?;
|
|
||||||
|
|
||||||
let success = response.status().is_success();
|
|
||||||
|
|
||||||
{
|
|
||||||
let response: GithubUserProjectResponse = response
|
|
||||||
.json()
|
|
||||||
.map_err(|error| format!("Failed deserializing response: {}", error))?;
|
|
||||||
|
|
||||||
if !success {
|
|
||||||
match response {
|
|
||||||
GithubUserProjectResponse::Failure(error) => return Err(error.message),
|
|
||||||
_ => return Err(String::from("Unknown response error")),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match response {
|
|
||||||
GithubUserProjectResponse::Failure(error) => {
|
|
||||||
return Err(format!(
|
|
||||||
"Received error response but no error code: {}",
|
|
||||||
error.message
|
|
||||||
))
|
|
||||||
}
|
|
||||||
GithubUserProjectResponse::Success(repo_list) => {
|
|
||||||
for repo in repo_list {
|
|
||||||
let (namespace, _name) = repo
|
|
||||||
.full_name
|
|
||||||
.rsplit_once('/')
|
|
||||||
.unwrap_or(("", &repo.full_name));
|
|
||||||
repos.push((namespace.to_string(), repo));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let headers = response.headers();
|
|
||||||
|
|
||||||
if let Some(link_header) = headers.get("link") {
|
|
||||||
let link_header = link_header.to_str().map_err(|error| error.to_string())?;
|
|
||||||
|
|
||||||
let link_header =
|
|
||||||
parse_link_header::parse(link_header).map_err(|error| error.to_string())?;
|
|
||||||
|
|
||||||
let next_page = link_header.get(&Some(String::from("next")));
|
|
||||||
|
|
||||||
if let Some(page) = next_page {
|
|
||||||
let following_repos = Github::get_repo_list_from_uri(&page.raw_uri, secret_token)?;
|
|
||||||
repos.extend(following_repos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(repos)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Provider for Github {
|
|
||||||
fn new(filter: Filter, secret_token: SecretToken) -> Self {
|
|
||||||
Github {
|
|
||||||
filter,
|
|
||||||
secret_token,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_repos(&self) -> Result<HashMap<String, Vec<RepoConfig>>, String> {
|
|
||||||
let mut namespaces: HashMap<String, HashMap<String, RepoConfig>> = HashMap::new();
|
|
||||||
|
|
||||||
let mut register = |namespace: String, repo: GithubProject| {
|
|
||||||
let name = repo.name.clone();
|
|
||||||
let repo_config = repo.into_repo_config();
|
|
||||||
match namespaces.get_mut(&namespace) {
|
|
||||||
Some(ns) => match ns.get_mut(&name) {
|
|
||||||
Some(_entry) => {}
|
|
||||||
None => {
|
|
||||||
ns.insert(name, repo_config);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
None => {
|
|
||||||
let mut ns = HashMap::new();
|
|
||||||
ns.insert(name, repo_config);
|
|
||||||
namespaces.insert(namespace, ns);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(users) = &self.filter.users {
|
|
||||||
for user in users {
|
|
||||||
let repos = Github::get_repo_list_from_uri(
|
|
||||||
&format!("https://api.github.com/users/{}/repos", user),
|
|
||||||
&self.secret_token,
|
|
||||||
)?;
|
|
||||||
for (namespace, repo) in repos {
|
|
||||||
register(namespace, repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(groups) = &self.filter.groups {
|
|
||||||
for group in groups {
|
|
||||||
let repos = Github::get_repo_list_from_uri(
|
|
||||||
&format!("https://api.github.com/orgs/{}/repos", group),
|
|
||||||
&self.secret_token,
|
|
||||||
)?;
|
|
||||||
for (namespace, repo) in repos {
|
|
||||||
register(namespace, repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.filter.owner {
|
|
||||||
let repos = Github::get_repo_list_from_uri(
|
|
||||||
"https://api.github.com/user/repos?affiliation=owner",
|
|
||||||
&self.secret_token,
|
|
||||||
)?;
|
|
||||||
for (namespace, repo) in repos {
|
|
||||||
register(namespace, repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut ret: HashMap<String, Vec<RepoConfig>> = HashMap::new();
|
|
||||||
for (namespace, repos) in namespaces {
|
|
||||||
ret.insert(namespace, repos.into_values().collect());
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(ret)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
pub mod github;
|
|
||||||
|
|
||||||
pub use github::Github;
|
|
||||||
|
|
||||||
use super::RepoConfig;
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
pub struct Filter {
|
|
||||||
users: Option<Vec<String>>,
|
|
||||||
groups: Option<Vec<String>>,
|
|
||||||
owner: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
type SecretToken = String;
|
|
||||||
|
|
||||||
impl Filter {
|
|
||||||
pub fn new(users: Option<Vec<String>>, groups: Option<Vec<String>>, owner: bool) -> Self {
|
|
||||||
Filter {
|
|
||||||
users,
|
|
||||||
groups,
|
|
||||||
owner,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait Provider {
|
|
||||||
fn new(filter: Filter, secret_token: SecretToken) -> Self;
|
|
||||||
fn get_repos(&self) -> Result<HashMap<String, Vec<RepoConfig>>, String>;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user