Merge branch 'master' into conditional-style

This commit is contained in:
Filip Bachul 2022-05-05 15:36:05 +02:00
commit 9e3c6589dc
16 changed files with 1420 additions and 760 deletions

View File

@ -645,8 +645,9 @@
"hostname": {
"default": {
"disabled": false,
"format": "[$hostname]($style) in ",
"format": "[$ssh_symbol$hostname]($style) in ",
"ssh_only": true,
"ssh_symbol": "🌐 ",
"style": "green dimmed bold",
"trim_at": "."
},
@ -3031,12 +3032,16 @@
"default": true,
"type": "boolean"
},
"ssh_symbol": {
"default": "🌐 ",
"type": "string"
},
"trim_at": {
"default": ".",
"type": "string"
},
"format": {
"default": "[$hostname]($style) in ",
"default": "[$ssh_symbol$hostname]($style) in ",
"type": "string"
},
"style": {

View File

@ -269,7 +269,7 @@ jobs:
needs: release_please
if: ${{ needs.release_please.outputs.release_created == 'true' }}
steps:
- uses: mislav/bump-homebrew-formula-action@v1.16
- uses: mislav/bump-homebrew-formula-action@v2.0
with:
formula-name: starship
tag-name: ${{ needs.release_please.outputs.tag_name }}

312
Cargo.lock generated
View File

@ -33,19 +33,20 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.56"
version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27"
checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
[[package]]
name = "async-broadcast"
version = "0.3.4"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90622698a1218e0b2fb846c97b5f19a0831f6baddee73d9454156365ccfa473b"
checksum = "1bbd92a9bd0e9c1298118ecf8a2f825e86b12c3ec9e411573e34aaf3a0c03cdd"
dependencies = [
"easy-parallel",
"event-listener",
"futures-core",
"parking_lot",
]
[[package]]
@ -272,9 +273,9 @@ dependencies = [
[[package]]
name = "clap"
version = "3.1.12"
version = "3.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c167e37342afc5f33fd87bbc870cedd020d2a6dffa05d45ccd9241fbdd146db"
checksum = "85a35a599b11c089a7f49105658d089b8f2cf0882993c17daf6de15285c2c35d"
dependencies = [
"atty",
"bitflags",
@ -290,9 +291,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "3.1.2"
version = "3.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1506b87ee866f7a53a5131f7b31fba656170d797e873d0609884cfd56b8bbda8"
checksum = "1d7ca9141e27e6ebc52e3c378b0c07f3cea52db46ed1cc5861735fb697b56356"
dependencies = [
"clap",
]
@ -312,18 +313,18 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.1.1"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "189ddd3b5d32a70b35e7686054371742a937b0d99128e76dde6340210e966669"
checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213"
dependencies = [
"os_str_bytes",
]
[[package]]
name = "combine"
version = "4.6.3"
version = "4.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062"
checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948"
dependencies = [
"bytes",
"memchr",
@ -340,9 +341,9 @@ dependencies = [
[[package]]
name = "const_format"
version = "0.2.22"
version = "0.2.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22bc6cd49b0ec407b680c3e380182b6ac63b73991cb7602de350352fc309b614"
checksum = "0936ffe6d0c8d6a51b3b0a73b2acbe925d786f346cf45bfddc8341d79fb7dc8a"
dependencies = [
"const_format_proc_macros",
]
@ -559,9 +560,9 @@ checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541"
[[package]]
name = "dyn-clone"
version = "1.0.4"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf"
checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28"
[[package]]
name = "easy-parallel"
@ -577,9 +578,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "enumflags2"
version = "0.7.4"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b3ab37dc79652c9d85f1f7b6070d77d321d2467f5fe7b00d6b7a86c57b092ae"
checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb"
dependencies = [
"enumflags2_derive",
"serde",
@ -596,6 +597,27 @@ dependencies = [
"syn",
]
[[package]]
name = "errno"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [
"errno-dragonfly",
"libc",
"winapi",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "event-listener"
version = "2.5.2"
@ -659,6 +681,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9d758e60b45e8d749c89c1b389ad8aee550f86aa12e2b9298b546dda7a82ab1"
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
[[package]]
name = "futures-core"
version = "0.3.21"
@ -765,9 +793,9 @@ dependencies = [
[[package]]
name = "git2"
version = "0.14.2"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c"
checksum = "5e77a14ffc6ba4ad5188d6cf428894c4fcfda725326b37558f35bb677e712cec"
dependencies = [
"bitflags",
"libc",
@ -776,6 +804,18 @@ dependencies = [
"url",
]
[[package]]
name = "guess_host_triple"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b35a8ce923c7490629d84e12fa2f75e1733f1ec692a47c264f9b7fd632855afc"
dependencies = [
"errno",
"libc",
"log",
"winapi",
]
[[package]]
name = "hashbrown"
version = "0.11.2"
@ -784,9 +824,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
name = "hashbrown"
version = "0.12.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
dependencies = [
"ahash",
]
@ -821,6 +861,15 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "home"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
dependencies = [
"winapi",
]
[[package]]
name = "idna"
version = "0.2.3"
@ -896,15 +945,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.121"
version = "0.2.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f"
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
[[package]]
name = "libgit2-sys"
version = "0.13.2+1.4.2"
version = "0.13.3+1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b"
checksum = "c24d36c3ac9b9996a2418d6bf428cc0bc5d1a814a84303fc60986088c5ed60de"
dependencies = [
"cc",
"libc",
@ -914,9 +963,9 @@ dependencies = [
[[package]]
name = "libz-sys"
version = "1.1.5"
version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f35facd4a5673cb5a48822be2be1d4236c1c99cb4113cab7061ac720d5bf859"
checksum = "92e7e15d7610cce1d9752e137625f14e61a28cd45929b6e12e47b50fe154ee2e"
dependencies = [
"cc",
"libc",
@ -937,10 +986,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6a104730949fbc4c78e4fa98ed769ca0faa02e9818936b61032d2d77526afa9"
[[package]]
name = "log"
version = "0.4.16"
name = "lock_api"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if 1.0.0",
]
@ -990,9 +1049,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "memchr"
version = "2.4.1"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memmem"
@ -1119,9 +1178,9 @@ dependencies = [
[[package]]
name = "num-integer"
version = "0.1.44"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"autocfg",
"num-traits",
@ -1129,9 +1188,9 @@ dependencies = [
[[package]]
name = "num-traits"
version = "0.2.14"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
]
@ -1204,9 +1263,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "open"
version = "2.1.1"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9213e7b66aa06a7722828ee2980c1adff22a3922b582baaa1e62e30ca2a6c018"
checksum = "e0524af9508f9b5c4eb41dce095860456727748f63b478d625f119a70e0d764a"
dependencies = [
"pathdiff",
"winapi",
@ -1228,7 +1287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a"
dependencies = [
"dlv-list",
"hashbrown 0.12.0",
"hashbrown 0.12.1",
]
[[package]]
@ -1243,9 +1302,9 @@ dependencies = [
[[package]]
name = "os_info"
version = "3.2.0"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "023df84d545ef479cf67fd2f4459a613585c9db4852c2fad12ab70587859d340"
checksum = "04304d855bb5385d4b595edf0147b8e281871766b75dd4c87b2bdf3c9e5c2d19"
dependencies = [
"log",
"serde",
@ -1264,6 +1323,31 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
[[package]]
name = "parking_lot"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [
"instant",
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
dependencies = [
"cfg-if 1.0.0",
"instant",
"libc",
"redox_syscall",
"smallvec",
"winapi",
]
[[package]]
name = "path-slash"
version = "0.1.4"
@ -1375,9 +1459,9 @@ dependencies = [
[[package]]
name = "pin-project-lite"
version = "0.2.8"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
[[package]]
name = "pin-utils"
@ -1476,9 +1560,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.36"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
dependencies = [
"unicode-xid",
]
@ -1505,13 +1589,26 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.17"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58"
checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
dependencies = [
"fuchsia-cprng",
"libc",
"rand_core 0.3.1",
"rdrand",
"winapi",
]
[[package]]
name = "rand"
version = "0.7.3"
@ -1557,6 +1654,21 @@ dependencies = [
"rand_core 0.6.3",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
dependencies = [
"rand_core 0.4.2",
]
[[package]]
name = "rand_core"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
[[package]]
name = "rand_core"
version = "0.5.1"
@ -1617,6 +1729,15 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "redox_syscall"
version = "0.2.13"
@ -1721,9 +1842,9 @@ dependencies = [
[[package]]
name = "semver"
version = "1.0.7"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4"
checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd"
[[package]]
name = "semver-parser"
@ -1736,18 +1857,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.136"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.136"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
dependencies = [
"proc-macro2",
"quote",
@ -1767,9 +1888,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.79"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
dependencies = [
"itoa",
"ryu",
@ -1778,9 +1899,9 @@ dependencies = [
[[package]]
name = "serde_repr"
version = "0.1.7"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5"
checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed"
dependencies = [
"proc-macro2",
"quote",
@ -1893,9 +2014,15 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "slab"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32"
[[package]]
name = "smallvec"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]]
name = "socket2"
@ -1921,6 +2048,8 @@ dependencies = [
"dunce",
"gethostname",
"git2",
"guess_host_triple",
"home",
"indexmap",
"local_ipaddress",
"log",
@ -1940,7 +2069,7 @@ dependencies = [
"regex",
"rust-ini",
"schemars",
"semver 1.0.7",
"semver 1.0.9",
"serde",
"serde_json",
"sha-1 0.10.0",
@ -2015,9 +2144,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.90"
version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f"
checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52"
dependencies = [
"proc-macro2",
"quote",
@ -2034,6 +2163,16 @@ dependencies = [
"libc",
]
[[package]]
name = "tempdir"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
dependencies = [
"rand 0.4.6",
"remove_dir_all",
]
[[package]]
name = "tempfile"
version = "3.3.0"
@ -2138,18 +2277,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.30"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.30"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
dependencies = [
"proc-macro2",
"quote",
@ -2179,9 +2318,9 @@ dependencies = [
[[package]]
name = "tinyvec"
version = "1.5.1"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
dependencies = [
"tinyvec_macros",
]
@ -2225,6 +2364,16 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "uds_windows"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "486992108df0fe0160680af1941fe856c521be931d5a5ecccefe0de86dc47e4a"
dependencies = [
"tempdir",
"winapi",
]
[[package]]
name = "unicase"
version = "2.6.0"
@ -2236,9 +2385,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.7"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-normalization"
@ -2263,9 +2412,9 @@ checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "unicode-xid"
version = "0.2.2"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04"
[[package]]
name = "uom"
@ -2566,9 +2715,9 @@ dependencies = [
[[package]]
name = "zbus"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bb86f3d4592e26a48b2719742aec94f8ae6238ebde20d98183ee185d1275e9a"
checksum = "53819092b9db813b2c6168b097b4b13ad284d81c9f2b0165a0a1b190e505a1f3"
dependencies = [
"async-broadcast",
"async-channel",
@ -2595,6 +2744,7 @@ dependencies = [
"serde_repr",
"sha1",
"static_assertions",
"uds_windows",
"winapi",
"zbus_macros",
"zbus_names",
@ -2603,9 +2753,9 @@ dependencies = [
[[package]]
name = "zbus_macros"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36823cc10fddc3c6b19f048903262dacaf8274170e9a255784bdd8b4570a8040"
checksum = "c7174ebe6722c280d6d132d694bb5664ce50a788cb70eeb518e7fc1ca095a114"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -2627,9 +2777,9 @@ dependencies = [
[[package]]
name = "zvariant"
version = "3.1.2"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49ea5dc38b2058fae6a5b79009388143dadce1e91c26a67f984a0fc0381c8033"
checksum = "e18ba99d71e03af262953f476071607da0c44e225236cf9b5b9f7f11f1d0b6b0"
dependencies = [
"byteorder",
"enumflags2",
@ -2641,9 +2791,9 @@ dependencies = [
[[package]]
name = "zvariant_derive"
version = "3.1.2"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2cecc5a61c2a053f7f653a24cd15b3b0195d7f7ddb5042c837fb32e161fb7a"
checksum = "9042892ebdca35261951a83d17bcbfd4d3d528cb3bde828498a9b306b50d05c0"
dependencies = [
"proc-macro-crate",
"proc-macro2",

View File

@ -38,8 +38,8 @@ notify = ["notify-rust"]
ansi_term = "0.12.1"
byte-unit = "4.0.14"
chrono = "0.4.19"
clap = { version = "3.1.12", features = ["derive", "cargo", "unicode"] }
clap_complete = "3.1.2"
clap = { version = "3.1.15", features = ["derive", "cargo", "unicode"] }
clap_complete = "3.1.3"
dirs-next = "2.0.0"
dunce = "1.0.2"
gethostname = "0.2.3"
@ -51,8 +51,8 @@ log = { version = "0.4.16", features = ["std"] }
# see: https://github.com/NixOS/nixpkgs/issues/160876
notify-rust = { version = "4.5.8", optional = true }
once_cell = "1.10.0"
open = "2.1.1"
os_info = "3.2.0"
open = "2.1.2"
os_info = "3.3.0"
path-slash = "0.1.4"
pest = "2.1.3"
pest_derive = "2.1.0"
@ -61,9 +61,9 @@ rand = "0.8.5"
rayon = "1.5.2"
regex = "1.5.5"
rust-ini = "0.18.0"
semver = "1.0.7"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
semver = "1.0.9"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
sha-1 = "0.10.0"
shadow-rs = "0.11.0"
# battery is optional (on by default) because the crate doesn't currently build for Termux
@ -83,6 +83,8 @@ yaml-rust = "0.4.5"
process_control = { version = "3.4.0", features = ["crossbeam-channel"] }
guess_host_triple = "0.1.3"
home = "0.5.3"
shell-words = "1.1.0"
[dependencies.schemars]

View File

@ -327,7 +327,7 @@ eval $(starship init ion)
<details>
<summary>Nushell</summary>
Run the following:
Add the following to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
```sh
mkdir ~/.cache/starship
@ -337,11 +337,10 @@ starship init nu | save ~/.cache/starship/init.nu
And add the following to the end of your Nushell configuration (find it by running `$nu.config-path`):
```sh
starship init nu | save ~/.cache/starship/init.nu
source ~/.cache/starship/init.nu
```
Note: Only Nushell v0.60+ is supported
Note: Only Nushell v0.61+ is supported
</details>

View File

@ -7,9 +7,19 @@ $directory\
$git_branch\
$git_status\
[](fg:#FCA17D bg:#86BBD8)\
$c\
$elixir\
$elm\
$golang\
$haskell\
$java\
$julia\
$nodejs\
$nim\
$rust\
[](fg:#86BBD8 bg:#33658A)\
[](fg:#86BBD8 bg:#06969A)\
$docker_context\
[](fg:#06969A bg:#33658A)\
$time\
[ ](fg:#33658A)\
"""
@ -43,6 +53,26 @@ truncation_symbol = "…/"
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important  " = "  "
[c]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[docker_context]
symbol = " "
style = "bg:#06969A"
format = '[[ $symbol $context ](bg:#06969A)]($style) $path'
[elixir]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[elm]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[git_branch]
symbol = ""
style = "bg:#FCA17D"
@ -52,11 +82,36 @@ format = '[[ $symbol $branch ](bg:#FCA17D)]($style)'
style = "bg:#FCA17D"
format = '[[($all_status$ahead_behind )](bg:#FCA17D)]($style)'
[golang]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[haskell]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[java]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[julia]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[nodejs]
symbol = ""
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[nim]
symbol = " "
style = "bg:#86BBD8"
format = '[[ $symbol ($version) ](bg:#86BBD8)]($style)'
[rust]
symbol = ""
style = "bg:#86BBD8"

View File

@ -139,11 +139,11 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
::: warning
This will change in the future.
Only Nushell v0.60+ is supported.
Only Nushell v0.61+ is supported.
:::
Run the following:
Add the following to to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
```sh
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
@ -152,8 +152,6 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
And add the following to the end of your Nushell configuration (find it by running `$nu.config-path`):
```sh
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
source ~/.cache/starship/init.nu
```
#### Xonsh

View File

@ -1805,20 +1805,22 @@ The `hostname` module shows the system hostname.
### Options
| Option | Default | Description |
| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$hostname]($style) in "` | The format for the module. |
| `style` | `"bold dimmed green"` | The style for the module. |
| `disabled` | `false` | Disables the `hostname` module. |
| Option | Default | Description |
| ------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `ssh_symbol` | `"🌐 "` | A format string representing the symbol when connected to SSH session. |
| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$ssh_symbol$hostname]($style) in "` | The format for the module. |
| `style` | `"bold dimmed green"` | The style for the module. |
| `disabled` | `false` | Disables the `hostname` module. |
### Variables
| Variable | Example | Description |
| -------- | ---------- | ----------------------------------- |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
| Variable | Example | Description |
| ---------- | ---------- | ----------------------------------------------------- |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
| ssh_symbol | `"🌏 "` | The symbol to represent when connected to SSH session |
*: This variable can only be used as a part of a style string
@ -1829,7 +1831,7 @@ The `hostname` module shows the system hostname.
[hostname]
ssh_only = false
format = "on [$hostname](bold red) "
format = "[$ssh_symbol](bold blue) on [$hostname](bold red) "
trim_at = ".companyname.com"
disabled = false
```
@ -2503,7 +2505,7 @@ symbol = "☁️ "
The `package` module is shown when the current directory is the repository for a
package, and shows its current version. The module currently supports `npm`, `nimble`, `cargo`,
`poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
`poetry`, `python`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present
in the current directory
@ -2511,7 +2513,7 @@ package, and shows its current version. The module currently supports `npm`, `ni
- [**Nimble**](https://github.com/nim-lang/nimble) - The `nimble` package version is extracted from the `*.nimble` file present in the current directory with the `nimble dump` command
- [**Poetry**](https://python-poetry.org/) The `poetry` package version is extracted from the `pyproject.toml` present
in the current directory
- [**Python**](https://www.python.org) - The `python` package version is extracted from the `setup.cfg` present in the current directory
- [**Python**](https://www.python.org) - The `python` package version is extracted from a [PEP 621](https://peps.python.org/pep-0621/) compliant `pyproject.toml` or a `setup.cfg` present in the current directory
- [**Composer**](https://getcomposer.org/) The `composer` package version is extracted from the `composer.json` present
in the current directory
- [**Gradle**](https://gradle.org/) The `gradle` package version is extracted from the `build.gradle` present
@ -2989,11 +2991,13 @@ The module will be shown if any of the following conditions are met:
### Variables
| Variable | Example | Description |
| -------- | ----------------- | ------------------------------------ |
| version | `v1.43.0-nightly` | The version of `rustc` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
| Variable | Example | Description |
| --------- | ----------------- | -------------------------------------------- |
| version | `v1.43.0-nightly` | The version of `rustc` |
| numver | `1.51.0` | The numeric component of the `rustc` version |
| toolchain | `beta` | The toolchain version |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string

View File

@ -336,20 +336,19 @@ print_install() {
;;
nushell )
# shellcheck disable=SC2088
config_file="your nu config file"
config_file="${BOLD}your nu config file${NO_COLOR} (find it by running ${BOLD}\$nu.config-path${NO_COLOR} in Nushell)"
config_cmd="mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
source ~/.cache/starship/init.nu"
warning="${warning} This will change in the future.
Only Nushell v0.60 or higher is supported.
You can check the location of this your config file by running \$nu.config-path in nu.
${BOLD}First run${NO_COLOR} \"mkdir ~/.cache/starship; starship init nu | save ~/.cache/starship/init.nu\""
Only Nushell v0.61 or higher is supported.
Add the following to the end of ${BOLD}your Nushell env file${NO_COLOR} (find it by running ${BOLD}\$nu.env-path${NO_COLOR} in Nushell): \"mkdir ~/.cache/starship; starship init nu | save ~/.cache/starship/init.nu\""
;;
esac
printf " %s\n %s\n Add the following to the end of %s:\n\n\t%s\n\n" \
printf " %s\n %s\n And add the following to the end of %s:\n\n\t%s\n\n" \
"${BOLD}${UNDERLINE}${s}${NO_COLOR}" \
"${warning}" \
"${BOLD}${config_file}${NO_COLOR}" \
"${config_file}" \
"${config_cmd}"
done

View File

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
#[serde(default)]
pub struct HostnameConfig<'a> {
pub ssh_only: bool,
pub ssh_symbol: &'a str,
pub trim_at: &'a str,
pub format: &'a str,
pub style: &'a str,
@ -15,8 +16,9 @@ impl<'a> Default for HostnameConfig<'a> {
fn default() -> Self {
HostnameConfig {
ssh_only: true,
ssh_symbol: "🌐 ",
trim_at: ".",
format: "[$hostname]($style) in ",
format: "[$ssh_symbol$hostname]($style) in ",
style: "green dimmed bold",
disabled: false,
}

View File

@ -266,12 +266,24 @@ pub fn write_configuration(doc: &Document) {
.expect("Error writing starship config");
}
pub fn edit_configuration() {
pub fn edit_configuration(editor_override: Option<&str>) -> Result<(), Box<dyn std::error::Error>> {
// Argument currently only used for testing, but could be used to specify
// an editor override on the command line.
let config_path = get_config_path();
let editor_cmd = shell_words::split(&get_editor()).expect("Unmatched quotes found in $EDITOR.");
let command = utils::create_command(&editor_cmd[0])
.expect("Unable to locate editor in $PATH.")
let editor_cmd = shell_words::split(&get_editor(editor_override))?;
let mut command = match utils::create_command(&editor_cmd[0]) {
Ok(cmd) => cmd,
Err(e) => {
eprintln!(
"Unable to find editor {:?}. Are $VISUAL and $EDITOR set correctly?",
editor_cmd[0]
);
return Err(Box::new(e));
}
};
let res = command
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
@ -279,24 +291,20 @@ pub fn edit_configuration() {
.arg(config_path)
.status();
match command {
Ok(_) => (),
Err(error) => match error.kind() {
ErrorKind::NotFound => {
eprintln!(
"Error: editor {:?} was not found. Did you set your $EDITOR or $VISUAL \
environment variables correctly?",
editor_cmd
);
std::process::exit(1)
}
other_error => panic!("failed to open file: {:?}", other_error),
},
};
if let Err(e) = res {
eprintln!("Unable to launch editor {:?}", editor_cmd);
return Err(Box::new(e));
}
Ok(())
}
fn get_editor() -> String {
get_editor_internal(env::var("VISUAL").ok(), env::var("EDITOR").ok())
fn get_editor(editor_override: Option<&str>) -> String {
if let Some(cmd) = editor_override {
cmd.to_string()
} else {
get_editor_internal(std::env::var("VISUAL").ok(), std::env::var("EDITOR").ok())
}
}
fn get_editor_internal(visual: Option<String>, editor: Option<String>) -> String {
@ -375,6 +383,18 @@ mod tests {
assert_eq!(STD_EDITOR, actual);
}
#[test]
fn no_panic_when_editor_unparseable() {
let outcome = edit_configuration(Some("\"vim"));
assert!(outcome.is_err());
}
#[test]
fn no_panic_when_editor_not_found() {
let outcome = edit_configuration(Some("this_editor_does_not_exist"));
assert!(outcome.is_err());
}
#[test]
fn test_extract_toml_paths() {
let config = toml::toml! {

View File

@ -187,8 +187,9 @@ fn main() {
if let Some(value) = value {
configure::update_configuration(&name, &value)
}
} else {
configure::edit_configuration()
} else if let Err(reason) = configure::edit_configuration(None) {
eprintln!("Could not edit configuration: {}", reason);
std::process::exit(1);
}
}
Commands::PrintConfig { default, name } => configure::print_configuration(default, &name),

View File

@ -593,7 +593,7 @@ mod tests {
let actual = ModuleRenderer::new("custom.test")
.path(dir.path())
.config(toml::toml! {
command_timeout = 10000
command_timeout = 100000
[custom.test]
format = "test"
when = when

View File

@ -43,6 +43,16 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let parsed = StringFormatter::new(config.format).and_then(|formatter| {
formatter
.map_meta(|var, _| match var {
"ssh_symbol" => {
if ssh_connection.is_some() {
Some(config.ssh_symbol)
} else {
None
}
}
_ => None,
})
.map_style(|variable| match variable {
"style" => Some(Ok(config.style)),
_ => None,
@ -86,7 +96,7 @@ mod tests {
}
#[test]
fn ssh_only_false() {
fn ssh_only_false_no_ssh() {
let hostname = get_hostname!();
let actual = ModuleRenderer::new("hostname")
.config(toml::toml! {
@ -96,7 +106,21 @@ mod tests {
})
.collect();
let expected = Some(format!("{} in ", style().paint(hostname)));
println!("{}", expected.as_ref().unwrap());
assert_eq!(expected, actual);
}
#[test]
fn ssh_only_false_ssh() {
let hostname = get_hostname!();
let actual = ModuleRenderer::new("hostname")
.config(toml::toml! {
[hostname]
ssh_only = false
trim_at = ""
})
.collect();
let expected = Some(format!("{} in ", style().paint(hostname)));
assert_eq!(expected, actual);
}
@ -124,7 +148,10 @@ mod tests {
})
.env("SSH_CONNECTION", "something")
.collect();
let expected = Some(format!("{} in ", style().paint(hostname)));
let expected = Some(format!(
"{} in ",
style().paint("🌐 ".to_owned() + &hostname)
));
assert_eq!(expected, actual);
}

View File

@ -66,16 +66,25 @@ fn get_node_package_version(context: &Context, config: &PackageConfig) -> Option
Some(formatted_version)
}
fn get_poetry_version(context: &Context, config: &PackageConfig) -> Option<String> {
let file_contents = context.read_file_from_pwd("pyproject.toml")?;
let poetry_toml: toml::Value = toml::from_str(&file_contents).ok()?;
let raw_version = poetry_toml
fn get_poetry_version(pyproject: &toml::Value) -> Option<&str> {
pyproject
.get("tool")?
.get("poetry")?
.get("version")?
.as_str()?;
.as_str()
}
format_version(raw_version, config.version_format)
fn get_pep621_version(pyproject: &toml::Value) -> Option<&str> {
pyproject.get("project")?.get("version")?.as_str()
}
fn get_pyproject_version(context: &Context, config: &PackageConfig) -> Option<String> {
let file_contents = context.read_file_from_pwd("pyproject.toml")?;
let pyproject_toml: toml::Value = toml::from_str(&file_contents).ok()?;
get_pep621_version(&pyproject_toml)
.or_else(|| get_poetry_version(&pyproject_toml))
.and_then(|raw_version| format_version(raw_version, config.version_format))
}
fn get_setup_cfg_version(context: &Context, config: &PackageConfig) -> Option<String> {
@ -252,7 +261,7 @@ fn get_version(context: &Context, config: &PackageConfig) -> Option<String> {
get_cargo_version,
get_nimble_version,
get_node_package_version,
get_poetry_version,
get_pyproject_version,
get_setup_cfg_version,
get_composer_version,
get_gradle_version,
@ -632,6 +641,69 @@ license = "MIT"
project_dir.close()
}
#[test]
fn test_extract_pep621_version() -> io::Result<()> {
let config_name = "pyproject.toml";
let config_content = toml::toml! {
[project]
name = "starship"
version = "0.1.0"
}
.to_string();
let project_dir = create_project_dir()?;
fill_config(&project_dir, config_name, Some(&config_content))?;
expect_output(&project_dir, Some("v0.1.0"), None);
project_dir.close()
}
#[test]
fn test_extract_pep621_version_without_version() -> io::Result<()> {
let config_name = "pyproject.toml";
let config_content = toml::toml! {
[project]
name = "starship"
}
.to_string();
let project_dir = create_project_dir()?;
fill_config(&project_dir, config_name, Some(&config_content))?;
expect_output(&project_dir, None, None);
project_dir.close()
}
#[test]
fn test_extract_pep621_version_attr_directive() -> io::Result<()> {
let config_name = "pyproject.toml";
let config_content = toml::toml! {
[project]
name = "starship"
version = {attr = "starship.__version__"}
}
.to_string();
let project_dir = create_project_dir()?;
fill_config(&project_dir, config_name, Some(&config_content))?;
expect_output(&project_dir, None, None);
project_dir.close()
}
#[test]
fn test_extract_pep621_version_file_directive() -> io::Result<()> {
let config_name = "pyproject.toml";
let config_content = toml::toml! {
[project]
name = "starship"
version = {file = "VERSION.txt"}
}
.to_string();
let project_dir = create_project_dir()?;
fill_config(&project_dir, config_name, Some(&config_content))?;
expect_output(&project_dir, None, None);
project_dir.close()
}
#[test]
fn test_extract_setup_cfg_version() -> io::Result<()> {
let config_name = "setup.cfg";

File diff suppressed because it is too large Load Diff