mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 10:53:38 +02:00
Compare commits
20 Commits
0.105.1
...
revert-159
Author | SHA1 | Date | |
---|---|---|---|
4f67310681 | |||
fb691c0da5 | |||
7972aea530 | |||
aa710eeb9a | |||
91e843a6d4 | |||
ebcb26f9d5 | |||
f8b0af70ff | |||
12465193a4 | |||
bd3930d00d | |||
81e86c40e1 | |||
2fe25d6299 | |||
4aeede2dd5 | |||
0e46ef9769 | |||
962467fdfd | |||
d27232df6e | |||
d7cec2088a | |||
22d1fdcdf6 | |||
ba59f71f20 | |||
2352548467 | |||
3efbda63b8 |
7
.github/workflows/winget-submission.yml
vendored
7
.github/workflows/winget-submission.yml
vendored
@ -10,6 +10,11 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
|
||||
winget:
|
||||
@ -25,5 +30,5 @@ jobs:
|
||||
installers-regex: 'msvc\.msi$'
|
||||
version: ${{ inputs.tag_name || github.event.release.tag_name }}
|
||||
release-tag: ${{ inputs.tag_name || github.event.release.tag_name }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
token: ${{ secrets.NUSHELL_PAT }}
|
||||
fork-user: nushell
|
||||
|
152
Cargo.lock
generated
152
Cargo.lock
generated
@ -96,32 +96,13 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi-str"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1cf4578926a981ab0ca955dc023541d19de37112bc24c1a197bd806d3d86ad1d"
|
||||
dependencies = [
|
||||
"ansitok 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi-str"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "060de1453b69f46304b28274f382132f4e72c55637cf362920926a70d090890d"
|
||||
dependencies = [
|
||||
"ansitok 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansitok"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83"
|
||||
dependencies = [
|
||||
"nom 7.1.3",
|
||||
"vte 0.10.1",
|
||||
"ansitok",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -235,12 +216,6 @@ version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.7.6"
|
||||
@ -720,7 +695,7 @@ dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools 0.11.0",
|
||||
"itertools 0.13.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
@ -766,7 +741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"arrayvec 0.7.6",
|
||||
"arrayvec",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"constant_time_eq",
|
||||
@ -1741,6 +1716,12 @@ dependencies = [
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_home"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe"
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.8.4"
|
||||
@ -3546,7 +3527,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"crossterm",
|
||||
@ -3600,7 +3581,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cli"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crossterm",
|
||||
@ -3637,7 +3618,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cmd-base"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"miette",
|
||||
@ -3649,7 +3630,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cmd-extra"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"fancy-regex",
|
||||
"heck",
|
||||
@ -3675,7 +3656,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cmd-lang"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"itertools 0.14.0",
|
||||
"miette",
|
||||
@ -3691,7 +3672,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cmd-plugin"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"itertools 0.14.0",
|
||||
"nu-engine",
|
||||
@ -3702,7 +3683,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-color-config"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-ansi-term",
|
||||
"nu-engine",
|
||||
@ -3714,7 +3695,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-command"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"alphanumeric-sort",
|
||||
"base64 0.22.1",
|
||||
@ -3831,7 +3812,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-derive-value"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error2",
|
||||
@ -3842,7 +3823,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-engine"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nu-glob",
|
||||
@ -3853,9 +3834,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-explore"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"ansi-str 0.8.0",
|
||||
"ansi-str",
|
||||
"anyhow",
|
||||
"crossterm",
|
||||
"log",
|
||||
@ -3877,14 +3858,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-glob"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"doc-comment",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nu-json"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"fancy-regex",
|
||||
"linked-hash-map",
|
||||
@ -3897,7 +3878,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-lsp"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"assert-json-diff",
|
||||
"crossbeam-channel",
|
||||
@ -3924,7 +3905,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-parser"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"bytesize",
|
||||
"chrono",
|
||||
@ -3941,7 +3922,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-path"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"dirs",
|
||||
"omnipath",
|
||||
@ -3951,7 +3932,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nix 0.29.0",
|
||||
@ -3967,7 +3948,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin-core"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"interprocess",
|
||||
"log",
|
||||
@ -3981,7 +3962,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin-engine"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nu-engine",
|
||||
@ -3997,7 +3978,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin-protocol"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-protocol",
|
||||
"nu-utils",
|
||||
@ -4009,7 +3990,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin-test-support"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-ansi-term",
|
||||
"nu-cmd-lang",
|
||||
@ -4027,7 +4008,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"heapless",
|
||||
"nu-ansi-term",
|
||||
@ -4036,7 +4017,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-protocol"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"brotli",
|
||||
"bytes",
|
||||
@ -4077,7 +4058,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-std"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"miette",
|
||||
@ -4088,7 +4069,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-system"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"itertools 0.14.0",
|
||||
@ -4106,7 +4087,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-table"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"fancy-regex",
|
||||
"nu-ansi-term",
|
||||
@ -4119,7 +4100,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-term-grid"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-utils",
|
||||
"unicode-width 0.2.0",
|
||||
@ -4127,7 +4108,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-test-support"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-glob",
|
||||
"nu-path",
|
||||
@ -4139,7 +4120,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-utils"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"crossterm",
|
||||
"crossterm_winapi",
|
||||
@ -4168,7 +4149,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_example"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-cmd-lang",
|
||||
"nu-plugin",
|
||||
@ -4178,7 +4159,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_formats"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"eml-parser",
|
||||
@ -4193,7 +4174,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"git2",
|
||||
"nu-plugin",
|
||||
@ -4202,7 +4183,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"nu-plugin",
|
||||
"nu-protocol",
|
||||
@ -4211,7 +4192,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_polars"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"aws-config",
|
||||
"aws-credential-types",
|
||||
@ -4250,7 +4231,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_query"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"gjson",
|
||||
"nu-plugin",
|
||||
@ -4265,7 +4246,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_stress_internals"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"interprocess",
|
||||
"serde",
|
||||
@ -4327,7 +4308,7 @@ version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3"
|
||||
dependencies = [
|
||||
"arrayvec 0.7.6",
|
||||
"arrayvec",
|
||||
"itoa",
|
||||
]
|
||||
|
||||
@ -4389,7 +4370,7 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
|
||||
|
||||
[[package]]
|
||||
name = "nuon"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"nu-engine",
|
||||
@ -4684,8 +4665,8 @@ version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6978128c8b51d8f4080631ceb2302ab51e32cc6e8615f735ee2f83fd269ae3f1"
|
||||
dependencies = [
|
||||
"ansi-str 0.9.0",
|
||||
"ansitok 0.3.0",
|
||||
"ansi-str",
|
||||
"ansitok",
|
||||
"bytecount",
|
||||
"fnv",
|
||||
"unicode-width 0.2.0",
|
||||
@ -6297,7 +6278,7 @@ version = "1.36.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555"
|
||||
dependencies = [
|
||||
"arrayvec 0.7.6",
|
||||
"arrayvec",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
@ -7156,8 +7137,8 @@ version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e39a2ee1fbcd360805a771e1b300f78cc88fec7b8d3e2f71cd37bbf23e725c7d"
|
||||
dependencies = [
|
||||
"ansi-str 0.9.0",
|
||||
"ansitok 0.3.0",
|
||||
"ansi-str",
|
||||
"ansitok",
|
||||
"papergrid",
|
||||
"testing_table",
|
||||
]
|
||||
@ -7238,7 +7219,7 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f8daae29995a24f65619e19d8d31dea5b389f3d853d8bf297bbf607cd0014cc"
|
||||
dependencies = [
|
||||
"ansitok 0.3.0",
|
||||
"ansitok",
|
||||
"unicode-width 0.2.0",
|
||||
]
|
||||
|
||||
@ -7371,9 +7352,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "titlecase"
|
||||
version = "3.5.0"
|
||||
version = "3.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1fad07d425f7245932d6deb5009e2c83d9642617b47750ffc3363815e269435"
|
||||
checksum = "eb567088a91d59b492520c8149e2be5ce10d5deb2d9a383f3378df3259679d40"
|
||||
dependencies = [
|
||||
"regex",
|
||||
]
|
||||
@ -7989,17 +7970,6 @@ version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
|
||||
|
||||
[[package]]
|
||||
name = "vte"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983"
|
||||
dependencies = [
|
||||
"arrayvec 0.5.2",
|
||||
"utf8parse",
|
||||
"vte_generate_state_changes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vte"
|
||||
version = "0.11.1"
|
||||
@ -8016,7 +7986,7 @@ version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077"
|
||||
dependencies = [
|
||||
"arrayvec 0.7.6",
|
||||
"arrayvec",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
@ -8295,13 +8265,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "7.0.0"
|
||||
version = "7.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9cad3279ade7346b96e38731a641d7343dd6a53d55083dd54eadfa5a1b38c6b"
|
||||
checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762"
|
||||
dependencies = [
|
||||
"either",
|
||||
"home",
|
||||
"rustix 0.38.42",
|
||||
"env_home",
|
||||
"rustix 1.0.7",
|
||||
"winsafe",
|
||||
]
|
||||
|
||||
|
46
Cargo.toml
46
Cargo.toml
@ -11,7 +11,7 @@ license = "MIT"
|
||||
name = "nu"
|
||||
repository = "https://github.com/nushell/nushell"
|
||||
rust-version = "1.85.1"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -63,7 +63,7 @@ members = [
|
||||
|
||||
[workspace.dependencies]
|
||||
alphanumeric-sort = "1.5"
|
||||
ansi-str = "0.8"
|
||||
ansi-str = "0.9"
|
||||
anyhow = "1.0.82"
|
||||
base64 = "0.22.1"
|
||||
bracoxide = "0.1.6"
|
||||
@ -163,7 +163,7 @@ syn = "2.0"
|
||||
sysinfo = "0.33"
|
||||
tabled = { version = "0.20", default-features = false }
|
||||
tempfile = "3.20"
|
||||
titlecase = "3.5"
|
||||
titlecase = "3.6"
|
||||
toml = "0.8"
|
||||
trash = "5.2"
|
||||
update-informer = { version = "1.2.0", default-features = false, features = ["github", "ureq"] }
|
||||
@ -184,7 +184,7 @@ uuid = "1.16.0"
|
||||
v_htmlescape = "0.15.0"
|
||||
wax = "0.6"
|
||||
web-time = "1.1.0"
|
||||
which = "7.0.0"
|
||||
which = "7.0.3"
|
||||
windows = "0.56"
|
||||
windows-sys = "0.48"
|
||||
winreg = "0.52"
|
||||
@ -200,22 +200,22 @@ unchecked_duration_subtraction = "warn"
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-cli = { path = "./crates/nu-cli", version = "0.105.1" }
|
||||
nu-cmd-base = { path = "./crates/nu-cmd-base", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.105.1" }
|
||||
nu-cmd-plugin = { path = "./crates/nu-cmd-plugin", version = "0.105.1", optional = true }
|
||||
nu-cmd-extra = { path = "./crates/nu-cmd-extra", version = "0.105.1" }
|
||||
nu-command = { path = "./crates/nu-command", version = "0.105.1", default-features = false, features = ["os"] }
|
||||
nu-engine = { path = "./crates/nu-engine", version = "0.105.1" }
|
||||
nu-explore = { path = "./crates/nu-explore", version = "0.105.1" }
|
||||
nu-lsp = { path = "./crates/nu-lsp/", version = "0.105.1" }
|
||||
nu-parser = { path = "./crates/nu-parser", version = "0.105.1" }
|
||||
nu-path = { path = "./crates/nu-path", version = "0.105.1" }
|
||||
nu-plugin-engine = { path = "./crates/nu-plugin-engine", optional = true, version = "0.105.1" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.105.1" }
|
||||
nu-std = { path = "./crates/nu-std", version = "0.105.1" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.105.1" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.105.1" }
|
||||
nu-cli = { path = "./crates/nu-cli", version = "0.105.2" }
|
||||
nu-cmd-base = { path = "./crates/nu-cmd-base", version = "0.105.2" }
|
||||
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.105.2" }
|
||||
nu-cmd-plugin = { path = "./crates/nu-cmd-plugin", version = "0.105.2", optional = true }
|
||||
nu-cmd-extra = { path = "./crates/nu-cmd-extra", version = "0.105.2" }
|
||||
nu-command = { path = "./crates/nu-command", version = "0.105.2", default-features = false, features = ["os"] }
|
||||
nu-engine = { path = "./crates/nu-engine", version = "0.105.2" }
|
||||
nu-explore = { path = "./crates/nu-explore", version = "0.105.2" }
|
||||
nu-lsp = { path = "./crates/nu-lsp/", version = "0.105.2" }
|
||||
nu-parser = { path = "./crates/nu-parser", version = "0.105.2" }
|
||||
nu-path = { path = "./crates/nu-path", version = "0.105.2" }
|
||||
nu-plugin-engine = { path = "./crates/nu-plugin-engine", optional = true, version = "0.105.2" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.105.2" }
|
||||
nu-std = { path = "./crates/nu-std", version = "0.105.2" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.105.2" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.105.2" }
|
||||
reedline = { workspace = true, features = ["bashisms", "sqlite"] }
|
||||
|
||||
crossterm = { workspace = true }
|
||||
@ -244,9 +244,9 @@ nix = { workspace = true, default-features = false, features = [
|
||||
] }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "./crates/nu-test-support", version = "0.105.1" }
|
||||
nu-plugin-protocol = { path = "./crates/nu-plugin-protocol", version = "0.105.1" }
|
||||
nu-plugin-core = { path = "./crates/nu-plugin-core", version = "0.105.1" }
|
||||
nu-test-support = { path = "./crates/nu-test-support", version = "0.105.2" }
|
||||
nu-plugin-protocol = { path = "./crates/nu-plugin-protocol", version = "0.105.2" }
|
||||
nu-plugin-core = { path = "./crates/nu-plugin-core", version = "0.105.2" }
|
||||
assert_cmd = "2.0"
|
||||
dirs = { workspace = true }
|
||||
tango-bench = "0.6"
|
||||
|
@ -5,29 +5,29 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cli"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-cli"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dev-dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.1" }
|
||||
nu-std = { path = "../nu-std", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.2" }
|
||||
nu-std = { path = "../nu-std", version = "0.105.2" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
rstest = { workspace = true, default-features = false }
|
||||
tempfile = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", features = ["os"] }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.1", optional = true }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["os"] }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.1" }
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", features = ["os"] }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.2", optional = true }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["os"] }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.2" }
|
||||
nu-ansi-term = { workspace = true }
|
||||
reedline = { workspace = true, features = ["bashisms", "sqlite"] }
|
||||
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-cmd-base"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-base"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -13,10 +13,10 @@ version = "0.105.1"
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
|
||||
indexmap = { workspace = true }
|
||||
miette = { workspace = true }
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-cmd-extra"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-extra"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -16,13 +16,13 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-json = { version = "0.105.1", path = "../nu-json" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-pretty-hex = { version = "0.105.1", path = "../nu-pretty-hex" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-json = { version = "0.105.2", path = "../nu-json" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-pretty-hex = { version = "0.105.2", path = "../nu-pretty-hex" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
|
||||
# Potential dependencies for extras
|
||||
heck = { workspace = true }
|
||||
@ -37,6 +37,6 @@ itertools = { workspace = true }
|
||||
mime = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.2" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
|
@ -6,7 +6,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-lang"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-cmd-lang"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -15,11 +15,11 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.2" }
|
||||
|
||||
itertools = { workspace = true }
|
||||
shadow-rs = { version = "1.1", default-features = false }
|
||||
|
@ -86,12 +86,16 @@ impl Command for OverlayHide {
|
||||
vec![]
|
||||
};
|
||||
|
||||
// also restore env vars which has been hidden
|
||||
let env_vars_to_restore = stack.get_hidden_env_vars(&overlay_name.item, engine_state);
|
||||
stack.remove_overlay(&overlay_name.item);
|
||||
for (name, val) in env_vars_to_restore {
|
||||
stack.add_env_var(name, val);
|
||||
}
|
||||
|
||||
for (name, val) in env_vars_to_keep {
|
||||
stack.add_env_var(name, val);
|
||||
}
|
||||
|
||||
Ok(PipelineData::empty())
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-cmd-plugin"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-plugin"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -13,10 +13,10 @@ version = "0.105.1"
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.2" }
|
||||
|
||||
itertools = { workspace = true }
|
||||
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-color-confi
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-color-config"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,12 +14,12 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-json = { path = "../nu-json", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-json = { path = "../nu-json", version = "0.105.2" }
|
||||
nu-ansi-term = { workspace = true }
|
||||
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-command"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-command"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -16,21 +16,21 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.105.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-system = { path = "../nu-system", version = "0.105.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.105.1" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.105.2" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-json = { path = "../nu-json", version = "0.105.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-system = { path = "../nu-system", version = "0.105.2" }
|
||||
nu-table = { path = "../nu-table", version = "0.105.2" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
nu-ansi-term = { workspace = true }
|
||||
nuon = { path = "../nuon", version = "0.105.1" }
|
||||
nuon = { path = "../nuon", version = "0.105.2" }
|
||||
|
||||
alphanumeric-sort = { workspace = true }
|
||||
base64 = { workspace = true }
|
||||
@ -226,8 +226,8 @@ sqlite = ["rusqlite"]
|
||||
trash-support = ["trash"]
|
||||
|
||||
[dev-dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
|
||||
dirs = { workspace = true }
|
||||
mockito = { workspace = true, default-features = false }
|
||||
|
@ -68,16 +68,40 @@ impl Command for HelpOperators {
|
||||
]
|
||||
.into_iter()
|
||||
.map(|op| {
|
||||
Value::record(
|
||||
record! {
|
||||
"type" => Value::string(op_type(&op), head),
|
||||
"operator" => Value::string(op.to_string(), head),
|
||||
"name" => Value::string(name(&op), head),
|
||||
"description" => Value::string(description(&op), head),
|
||||
"precedence" => Value::int(op.precedence().into(), head),
|
||||
},
|
||||
head,
|
||||
)
|
||||
if op == Operator::Comparison(Comparison::RegexMatch) {
|
||||
Value::record(
|
||||
record! {
|
||||
"type" => Value::string(op_type(&op), head),
|
||||
"operator" => Value::string("=~, like", head),
|
||||
"name" => Value::string(name(&op), head),
|
||||
"description" => Value::string(description(&op), head),
|
||||
"precedence" => Value::int(op.precedence().into(), head),
|
||||
},
|
||||
head,
|
||||
)
|
||||
} else if op == Operator::Comparison(Comparison::NotRegexMatch) {
|
||||
Value::record(
|
||||
record! {
|
||||
"type" => Value::string(op_type(&op), head),
|
||||
"operator" => Value::string("!~, not-like", head),
|
||||
"name" => Value::string(name(&op), head),
|
||||
"description" => Value::string(description(&op), head),
|
||||
"precedence" => Value::int(op.precedence().into(), head),
|
||||
},
|
||||
head,
|
||||
)
|
||||
} else {
|
||||
Value::record(
|
||||
record! {
|
||||
"type" => Value::string(op_type(&op), head),
|
||||
"operator" => Value::string(op.to_string(), head),
|
||||
"name" => Value::string(name(&op), head),
|
||||
"description" => Value::string(description(&op), head),
|
||||
"precedence" => Value::int(op.precedence().into(), head),
|
||||
},
|
||||
head,
|
||||
)
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
@ -275,11 +275,8 @@ impl Command for External {
|
||||
);
|
||||
|
||||
let mut child = child.map_err(|err| {
|
||||
IoError::new_internal(
|
||||
err,
|
||||
"Could not spawn foreground child",
|
||||
nu_protocol::location!(),
|
||||
)
|
||||
let context = format!("Could not spawn foreground child: {err}");
|
||||
IoError::new_internal(err, context, nu_protocol::location!())
|
||||
})?;
|
||||
|
||||
if let Some(thread_job) = engine_state.current_thread_job() {
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-derive-value"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-derive-value"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-engine"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-engine"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,10 +14,10 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
log = { workspace = true }
|
||||
|
||||
[features]
|
||||
|
@ -1,7 +1,6 @@
|
||||
use crate::eval_ir_block;
|
||||
#[allow(deprecated)]
|
||||
use crate::get_full_help;
|
||||
use nu_path::{AbsolutePathBuf, expand_path_with};
|
||||
use nu_protocol::{
|
||||
BlockId, Config, DataSource, ENV_VARIABLE_ID, IntoPipelineData, PipelineData, PipelineMetadata,
|
||||
ShellError, Span, Value, VarId,
|
||||
@ -404,45 +403,6 @@ impl Eval for EvalRuntime {
|
||||
stack.get_config(engine_state)
|
||||
}
|
||||
|
||||
fn eval_filepath(
|
||||
engine_state: &EngineState,
|
||||
stack: &mut Stack,
|
||||
path: String,
|
||||
quoted: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError> {
|
||||
if quoted {
|
||||
Ok(Value::string(path, span))
|
||||
} else {
|
||||
let cwd = engine_state.cwd(Some(stack))?;
|
||||
let path = expand_path_with(path, cwd, true);
|
||||
|
||||
Ok(Value::string(path.to_string_lossy(), span))
|
||||
}
|
||||
}
|
||||
|
||||
fn eval_directory(
|
||||
engine_state: Self::State<'_>,
|
||||
stack: &mut Self::MutState,
|
||||
path: String,
|
||||
quoted: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError> {
|
||||
if path == "-" {
|
||||
Ok(Value::string("-", span))
|
||||
} else if quoted {
|
||||
Ok(Value::string(path, span))
|
||||
} else {
|
||||
let cwd = engine_state
|
||||
.cwd(Some(stack))
|
||||
.map(AbsolutePathBuf::into_std_path_buf)
|
||||
.unwrap_or_default();
|
||||
let path = expand_path_with(path, cwd, true);
|
||||
|
||||
Ok(Value::string(path.to_string_lossy(), span))
|
||||
}
|
||||
}
|
||||
|
||||
fn eval_var(
|
||||
engine_state: &EngineState,
|
||||
stack: &mut Stack,
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::{borrow::Cow, fs::File, sync::Arc};
|
||||
|
||||
use nu_path::{AbsolutePathBuf, expand_path_with};
|
||||
use nu_path::{expand_path, expand_path_with};
|
||||
use nu_protocol::{
|
||||
DataSource, DeclId, ENV_VARIABLE_ID, Flag, IntoPipelineData, IntoSpanned, ListStream, OutDest,
|
||||
PipelineData, PipelineMetadata, PositionalArg, Range, Record, RegId, ShellError, Signals,
|
||||
@ -888,9 +888,7 @@ fn literal_value(
|
||||
if *no_expand {
|
||||
Value::string(path, span)
|
||||
} else {
|
||||
let cwd = ctx.engine_state.cwd(Some(ctx.stack))?;
|
||||
let path = expand_path_with(path, cwd, true);
|
||||
|
||||
let path = expand_path(path, true);
|
||||
Value::string(path.to_string_lossy(), span)
|
||||
}
|
||||
}
|
||||
@ -904,13 +902,7 @@ fn literal_value(
|
||||
} else if *no_expand {
|
||||
Value::string(path, span)
|
||||
} else {
|
||||
let cwd = ctx
|
||||
.engine_state
|
||||
.cwd(Some(ctx.stack))
|
||||
.map(AbsolutePathBuf::into_std_path_buf)
|
||||
.unwrap_or_default();
|
||||
let path = expand_path_with(path, cwd, true);
|
||||
|
||||
let path = expand_path(path, true);
|
||||
Value::string(path.to_string_lossy(), span)
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-explore"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-explore"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,16 +14,16 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.105.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2" }
|
||||
nu-table = { path = "../nu-table", version = "0.105.2" }
|
||||
nu-json = { path = "../nu-json", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
nu-ansi-term = { workspace = true }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.105.1" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.105.2" }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
log = { workspace = true }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nu-glob"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
authors = ["The Nushell Project Developers", "The Rust Project Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = """
|
||||
|
@ -8,7 +8,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-json"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-json"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -26,8 +26,8 @@ serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
serde_json = "1.0"
|
||||
fancy-regex = "0.14.0"
|
||||
|
||||
|
@ -3,16 +3,16 @@ authors = ["The Nushell Project Developers"]
|
||||
description = "Nushell's integrated LSP server"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-lsp"
|
||||
name = "nu-lsp"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
nu-cli = { path = "../nu-cli", version = "0.105.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-cli = { path = "../nu-cli", version = "0.105.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
crossbeam-channel = { workspace = true }
|
||||
lsp-server = { workspace = true }
|
||||
@ -26,11 +26,11 @@ serde_json = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1" }
|
||||
nu-std = { path = "../nu-std", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2" }
|
||||
nu-std = { path = "../nu-std", version = "0.105.2" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
|
||||
assert-json-diff = "2.0"
|
||||
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-parser"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-parser"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
exclude = ["/fuzz"]
|
||||
|
||||
[lib]
|
||||
@ -15,11 +15,11 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", optional = true, version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", optional = true, version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
|
||||
bytesize = { workspace = true }
|
||||
chrono = { default-features = false, features = ['std'], workspace = true }
|
||||
|
@ -2801,13 +2801,24 @@ pub fn parse_unit_value<'res>(
|
||||
None => number_part,
|
||||
};
|
||||
|
||||
// Convert all durations to nanoseconds to not lose precision
|
||||
let num = match unit_to_ns_factor(&unit) {
|
||||
// Convert all durations to nanoseconds, and filesizes to bytes,
|
||||
// to minimize loss of precision
|
||||
let factor = match ty {
|
||||
Type::Filesize => unit_to_byte_factor(&unit),
|
||||
Type::Duration => unit_to_ns_factor(&unit),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
let num = match factor {
|
||||
Some(factor) => {
|
||||
let num_ns = num_float * factor;
|
||||
if i64::MIN as f64 <= num_ns && num_ns <= i64::MAX as f64 {
|
||||
unit = Unit::Nanosecond;
|
||||
num_ns as i64
|
||||
let num_base = num_float * factor;
|
||||
if i64::MIN as f64 <= num_base && num_base <= i64::MAX as f64 {
|
||||
unit = if ty == Type::Filesize {
|
||||
Unit::Filesize(FilesizeUnit::B)
|
||||
} else {
|
||||
Unit::Nanosecond
|
||||
};
|
||||
num_base as i64
|
||||
} else {
|
||||
// not safe to convert, because of the overflow
|
||||
num_float as i64
|
||||
@ -2934,6 +2945,27 @@ fn unit_to_ns_factor(unit: &Unit) -> Option<f64> {
|
||||
}
|
||||
}
|
||||
|
||||
fn unit_to_byte_factor(unit: &Unit) -> Option<f64> {
|
||||
match unit {
|
||||
Unit::Filesize(FilesizeUnit::B) => Some(1.0),
|
||||
Unit::Filesize(FilesizeUnit::KB) => Some(1_000.0),
|
||||
Unit::Filesize(FilesizeUnit::MB) => Some(1_000_000.0),
|
||||
Unit::Filesize(FilesizeUnit::GB) => Some(1_000_000_000.0),
|
||||
Unit::Filesize(FilesizeUnit::TB) => Some(1_000_000_000_000.0),
|
||||
Unit::Filesize(FilesizeUnit::PB) => Some(1_000_000_000_000_000.0),
|
||||
Unit::Filesize(FilesizeUnit::EB) => Some(1_000_000_000_000_000_000.0),
|
||||
Unit::Filesize(FilesizeUnit::KiB) => Some(1024.0),
|
||||
Unit::Filesize(FilesizeUnit::MiB) => Some(1024.0 * 1024.0),
|
||||
Unit::Filesize(FilesizeUnit::GiB) => Some(1024.0 * 1024.0 * 1024.0),
|
||||
Unit::Filesize(FilesizeUnit::TiB) => Some(1024.0 * 1024.0 * 1024.0 * 1024.0),
|
||||
Unit::Filesize(FilesizeUnit::PiB) => Some(1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0),
|
||||
Unit::Filesize(FilesizeUnit::EiB) => {
|
||||
Some(1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
// Borrowed from libm at https://github.com/rust-lang/libm/blob/master/src/math/modf.rs
|
||||
fn modf(x: f64) -> (f64, f64) {
|
||||
let rv2: f64;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use nu_parser::*;
|
||||
use nu_protocol::{
|
||||
DeclId, ParseError, Signature, Span, SyntaxShape, Type,
|
||||
DeclId, FilesizeUnit, ParseError, Signature, Span, SyntaxShape, Type, Unit,
|
||||
ast::{Argument, Expr, Expression, ExternalArgument, PathMember, Range},
|
||||
engine::{Command, EngineState, Stack, StateWorkingSet},
|
||||
};
|
||||
@ -270,6 +270,28 @@ pub fn parse_int_with_underscores() {
|
||||
assert_eq!(element.expr.expr, Expr::Int(420692023));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn parse_filesize() {
|
||||
let engine_state = EngineState::new();
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
|
||||
let block = parse(&mut working_set, None, b"95307.27MiB", true);
|
||||
|
||||
assert!(working_set.parse_errors.is_empty());
|
||||
assert_eq!(block.len(), 1);
|
||||
let pipeline = &block.pipelines[0];
|
||||
assert_eq!(pipeline.len(), 1);
|
||||
let element = &pipeline.elements[0];
|
||||
assert!(element.redirection.is_none());
|
||||
|
||||
let Expr::ValueWithUnit(value) = &element.expr.expr else {
|
||||
panic!("should be a ValueWithUnit");
|
||||
};
|
||||
|
||||
assert_eq!(value.expr.expr, Expr::Int(99_936_915_947));
|
||||
assert_eq!(value.unit.item, Unit::Filesize(FilesizeUnit::B));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn parse_cell_path() {
|
||||
let engine_state = EngineState::new();
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-path"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-path"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
exclude = ["/fuzz"]
|
||||
|
||||
[lib]
|
||||
|
@ -60,7 +60,10 @@ where
|
||||
canonicalize(path)
|
||||
}
|
||||
|
||||
fn expand_path(path: impl AsRef<Path>, need_expand_tilde: bool) -> PathBuf {
|
||||
/// Resolve only path components (tilde, ., .., ...+), if possible.
|
||||
///
|
||||
/// Doesn't convert to absolute form or use syscalls. Output may begin with "../"
|
||||
pub fn expand_path(path: impl AsRef<Path>, need_expand_tilde: bool) -> PathBuf {
|
||||
let path = if need_expand_tilde {
|
||||
expand_tilde(path)
|
||||
} else {
|
||||
@ -77,7 +80,7 @@ fn expand_path(path: impl AsRef<Path>, need_expand_tilde: bool) -> PathBuf {
|
||||
///
|
||||
/// Furthermore, unlike canonicalize(), it does not use sys calls (such as readlink).
|
||||
///
|
||||
/// Does not convert to absolute form nor does it resolve symlinks.
|
||||
/// Converts to absolute form but does not resolve symlinks.
|
||||
/// The input path is specified relative to another path
|
||||
pub fn expand_path_with<P, Q>(path: P, relative_to: Q, expand_tilde: bool) -> PathBuf
|
||||
where
|
||||
|
@ -10,7 +10,9 @@ mod tilde;
|
||||
mod trailing_slash;
|
||||
|
||||
pub use components::components;
|
||||
pub use expansions::{canonicalize_with, expand_path_with, expand_to_real_path, locate_in_dirs};
|
||||
pub use expansions::{
|
||||
canonicalize_with, expand_path, expand_path_with, expand_to_real_path, locate_in_dirs,
|
||||
};
|
||||
pub use helpers::{cache_dir, data_dir, home_dir, nu_config_dir};
|
||||
pub use path::*;
|
||||
pub use tilde::expand_tilde;
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-core
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-plugin-core"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,8 +14,8 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.1", default-features = false }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.2", default-features = false }
|
||||
|
||||
rmp-serde = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-engi
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-plugin-engine"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,12 +14,12 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-system = { path = "../nu-system", version = "0.105.1" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.1" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
nu-system = { path = "../nu-system", version = "0.105.2" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.2" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
serde = { workspace = true }
|
||||
log = { workspace = true }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-prot
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-plugin-protocol"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,8 +14,8 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
rmp-serde = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nu-plugin-test-support"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
description = "Testing support for Nushell plugins"
|
||||
@ -15,14 +15,14 @@ workspace = true
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", features = ["plugin"] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.1" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.1" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", features = ["plugin"] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.2" }
|
||||
nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.105.2" }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.2" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-ansi-term = { workspace = true }
|
||||
similar = "2.7"
|
||||
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-plugin"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,11 +14,11 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", features = ["plugin"] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.1" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", features = ["plugin"] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
nu-plugin-protocol = { path = "../nu-plugin-protocol", version = "0.105.2" }
|
||||
nu-plugin-core = { path = "../nu-plugin-core", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
log = { workspace = true }
|
||||
thiserror = "2.0.12"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-pretty-hex"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-protocol"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-protocol"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -16,11 +16,11 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-system = { path = "../nu-system", version = "0.105.1" }
|
||||
nu-derive-value = { path = "../nu-derive-value", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-system = { path = "../nu-system", version = "0.105.2" }
|
||||
nu-derive-value = { path = "../nu-derive-value", version = "0.105.2" }
|
||||
|
||||
brotli = { workspace = true, optional = true }
|
||||
bytes = { workspace = true }
|
||||
@ -68,8 +68,8 @@ plugin = [
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = { workspace = true }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
pretty_assertions = { workspace = true }
|
||||
rstest = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
|
@ -128,7 +128,8 @@ impl Call {
|
||||
|
||||
pub fn named_iter(
|
||||
&self,
|
||||
) -> impl Iterator<Item = &(Spanned<String>, Option<Spanned<String>>, Option<Expression>)> {
|
||||
) -> impl DoubleEndedIterator<Item = &(Spanned<String>, Option<Spanned<String>>, Option<Expression>)>
|
||||
{
|
||||
self.arguments.iter().filter_map(|arg| match arg {
|
||||
Argument::Named(named) => Some(named),
|
||||
Argument::Positional(_) => None,
|
||||
@ -222,7 +223,7 @@ impl Call {
|
||||
}
|
||||
|
||||
pub fn get_flag_expr(&self, flag_name: &str) -> Option<&Expression> {
|
||||
for name in self.named_iter() {
|
||||
for name in self.named_iter().rev() {
|
||||
if flag_name == name.0.item {
|
||||
return name.2.as_ref();
|
||||
}
|
||||
@ -232,7 +233,7 @@ impl Call {
|
||||
}
|
||||
|
||||
pub fn get_named_arg(&self, flag_name: &str) -> Option<Spanned<String>> {
|
||||
for name in self.named_iter() {
|
||||
for name in self.named_iter().rev() {
|
||||
if flag_name == name.0.item {
|
||||
return Some(name.0.clone());
|
||||
}
|
||||
|
@ -414,6 +414,37 @@ impl Stack {
|
||||
result
|
||||
}
|
||||
|
||||
/// Get hidden envs, but without envs defined previously in `excluded_overlay_name`.
|
||||
pub fn get_hidden_env_vars(
|
||||
&self,
|
||||
excluded_overlay_name: &str,
|
||||
engine_state: &EngineState,
|
||||
) -> HashMap<String, Value> {
|
||||
let mut result = HashMap::new();
|
||||
|
||||
for overlay_name in self.active_overlays.iter().rev() {
|
||||
if overlay_name == excluded_overlay_name {
|
||||
continue;
|
||||
}
|
||||
if let Some(env_names) = self.env_hidden.get(overlay_name) {
|
||||
for n in env_names {
|
||||
if result.contains_key(n) {
|
||||
continue;
|
||||
}
|
||||
// get env value.
|
||||
if let Some(Some(v)) = engine_state
|
||||
.env_vars
|
||||
.get(overlay_name)
|
||||
.map(|env_vars| env_vars.get(n))
|
||||
{
|
||||
result.insert(n.to_string(), v.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
/// Same as get_env_vars, but returns only the names as a HashSet
|
||||
pub fn get_env_var_names(&self, engine_state: &EngineState) -> HashSet<String> {
|
||||
let mut result = HashSet::new();
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! Foundational [`Eval`] trait allowing dispatch between const-eval and regular evaluation
|
||||
use nu_path::expand_path;
|
||||
|
||||
use crate::{
|
||||
BlockId, Config, ENV_VARIABLE_ID, GetSpan, Range, Record, ShellError, Span, Value, VarId,
|
||||
ast::{
|
||||
@ -32,9 +34,23 @@ pub trait Eval {
|
||||
Expr::Int(i) => Ok(Value::int(*i, expr_span)),
|
||||
Expr::Float(f) => Ok(Value::float(*f, expr_span)),
|
||||
Expr::Binary(b) => Ok(Value::binary(b.clone(), expr_span)),
|
||||
Expr::Filepath(path, quoted) => Self::eval_filepath(state, mut_state, path.clone(), *quoted, expr_span),
|
||||
Expr::Filepath(path, quoted) => {
|
||||
if *quoted {
|
||||
Ok(Value::string(path, expr_span))
|
||||
} else {
|
||||
let path = expand_path(path, true);
|
||||
Ok(Value::string(path.to_string_lossy(), expr_span))
|
||||
}
|
||||
}
|
||||
Expr::Directory(path, quoted) => {
|
||||
Self::eval_directory(state, mut_state, path.clone(), *quoted, expr_span)
|
||||
if path == "-" {
|
||||
Ok(Value::string("-", expr_span))
|
||||
} else if *quoted {
|
||||
Ok(Value::string(path, expr_span))
|
||||
} else {
|
||||
let path = expand_path(path, true);
|
||||
Ok(Value::string(path.to_string_lossy(), expr_span))
|
||||
}
|
||||
}
|
||||
Expr::Var(var_id) => Self::eval_var(state, mut_state, *var_id, expr_span),
|
||||
Expr::CellPath(cell_path) => Ok(Value::cell_path(cell_path.clone(), expr_span)),
|
||||
@ -329,22 +345,6 @@ pub trait Eval {
|
||||
|
||||
fn get_config(state: Self::State<'_>, mut_state: &mut Self::MutState) -> Arc<Config>;
|
||||
|
||||
fn eval_filepath(
|
||||
state: Self::State<'_>,
|
||||
mut_state: &mut Self::MutState,
|
||||
path: String,
|
||||
quoted: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError>;
|
||||
|
||||
fn eval_directory(
|
||||
state: Self::State<'_>,
|
||||
mut_state: &mut Self::MutState,
|
||||
path: String,
|
||||
quoted: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError>;
|
||||
|
||||
fn eval_var(
|
||||
state: Self::State<'_>,
|
||||
mut_state: &mut Self::MutState,
|
||||
|
@ -441,26 +441,6 @@ impl Eval for EvalConst {
|
||||
state.get_config().clone()
|
||||
}
|
||||
|
||||
fn eval_filepath(
|
||||
_: &StateWorkingSet,
|
||||
_: &mut (),
|
||||
path: String,
|
||||
_: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError> {
|
||||
Ok(Value::string(path, span))
|
||||
}
|
||||
|
||||
fn eval_directory(
|
||||
_: &StateWorkingSet,
|
||||
_: &mut (),
|
||||
_: String,
|
||||
_: bool,
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError> {
|
||||
Err(ShellError::NotAConstant { span })
|
||||
}
|
||||
|
||||
fn eval_var(
|
||||
working_set: &StateWorkingSet,
|
||||
_: &mut (),
|
||||
|
@ -7,7 +7,7 @@ use crate::{ShellError, Span, Type, Value, ast::Operator};
|
||||
pub trait CustomValue: fmt::Debug + Send + Sync {
|
||||
/// Custom `Clone` implementation
|
||||
///
|
||||
/// This can reemit a `Value::CustomValue(Self, span)` or materialize another representation
|
||||
/// This can reemit a `Value::Custom(Self, span)` or materialize another representation
|
||||
/// if necessary.
|
||||
fn clone_value(&self, span: Span) -> Value;
|
||||
|
||||
|
@ -1981,7 +1981,7 @@ impl Value {
|
||||
/// as it will point into unknown source when used in errors.
|
||||
///
|
||||
/// Returns a `Vec` containing one of each value case (`Value::Int`, `Value::String`, etc.)
|
||||
/// except for `Value::CustomValue`.
|
||||
/// except for `Value::Custom`.
|
||||
pub fn test_values() -> Vec<Value> {
|
||||
vec![
|
||||
Value::test_bool(false),
|
||||
|
@ -5,12 +5,12 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-std"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-std"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[dependencies]
|
||||
nu-parser = { version = "0.105.1", path = "../nu-parser" }
|
||||
nu-protocol = { version = "0.105.1", path = "../nu-protocol", default-features = false }
|
||||
nu-engine = { version = "0.105.1", path = "../nu-engine", default-features = false }
|
||||
nu-parser = { version = "0.105.2", path = "../nu-parser" }
|
||||
nu-protocol = { version = "0.105.2", path = "../nu-protocol", default-features = false }
|
||||
nu-engine = { version = "0.105.2", path = "../nu-engine", default-features = false }
|
||||
miette = { workspace = true, features = ["fancy-no-backtrace"] }
|
||||
|
||||
log = "0.4"
|
||||
|
@ -64,6 +64,7 @@ pub fn load_standard_library(
|
||||
"std/testing",
|
||||
include_str!("../std/testing/mod.nu"),
|
||||
),
|
||||
("mod.nu", "std/clip", include_str!("../std/clip/mod.nu")),
|
||||
];
|
||||
|
||||
for (filename, std_subdir_name, content) in std_submodules.drain(..) {
|
||||
|
@ -1,48 +1,38 @@
|
||||
# The clip module has been added to std. This std-rfc module is deprecated and will be removed.
|
||||
#
|
||||
# Commands for interacting with the system clipboard
|
||||
#
|
||||
# > These commands require your terminal to support OSC 52
|
||||
# > Terminal multiplexers such as screen, tmux, zellij etc may interfere with this command
|
||||
|
||||
module std-clip {
|
||||
export use std/clip *
|
||||
}
|
||||
|
||||
use std-clip
|
||||
|
||||
# Copy input to system clipboard
|
||||
@deprecated "The clip module has been moved to std. Please use the std version instead of the std-rfc version." --since 0.105.0 --remove 0.107.0
|
||||
@example "Copy a string to the clipboard" {
|
||||
"Hello" | clip copy
|
||||
}
|
||||
export def copy [
|
||||
--ansi (-a) # Copy ansi formatting
|
||||
]: any -> nothing {
|
||||
let input = $in | collect
|
||||
if not $ansi {
|
||||
$env.config.use_ansi_coloring = false
|
||||
}
|
||||
let text = match ($input | describe -d | get type) {
|
||||
$type if $type in [ table, record, list ] => {
|
||||
$input | table -e
|
||||
}
|
||||
_ => {$input}
|
||||
}
|
||||
|
||||
print -n $'(ansi osc)52;c;($text | encode base64)(ansi st)'
|
||||
std-clip copy --ansi=$ansi
|
||||
}
|
||||
|
||||
# Paste contents of system clipboard
|
||||
@deprecated "The clip module has been moved to std. Please use the std version instead of the std-rfc version." --since 0.105.0 --remove 0.107.0
|
||||
@example "Paste a string from the clipboard" {
|
||||
clip paste
|
||||
} --result "Hello"
|
||||
export def paste []: [nothing -> string] {
|
||||
try {
|
||||
term query $'(ansi osc)52;c;?(ansi st)' -p $'(ansi osc)52;c;' -t (ansi st)
|
||||
} catch {
|
||||
error make -u {
|
||||
msg: "Terminal did not responds to OSC 52 paste request."
|
||||
help: $"Check if your terminal supports OSC 52."
|
||||
}
|
||||
}
|
||||
| decode
|
||||
| decode base64
|
||||
| decode
|
||||
std-clip paste
|
||||
}
|
||||
|
||||
# Add a prefix to each line of the content to be copied
|
||||
@deprecated "The clip module has been moved to std. Please use the std version instead of the std-rfc version." --since 0.105.0 --remove 0.107.0
|
||||
@example "Format output for Nushell doc" {
|
||||
[1 2 3] | clip prefix '# => '
|
||||
} --result "# => ╭───┬───╮
|
||||
@ -55,12 +45,5 @@ export def paste []: [nothing -> string] {
|
||||
ls | clip prefix '# => ' | clip copy
|
||||
}
|
||||
export def prefix [prefix: string]: any -> string {
|
||||
let input = $in | collect
|
||||
match ($input | describe -d | get type) {
|
||||
$type if $type in [ table, record, list ] => {
|
||||
$input | table -e
|
||||
}
|
||||
_ => {$input}
|
||||
}
|
||||
| str replace -r --all '(?m)(.*)' $'($prefix)$1'
|
||||
std-clip prefix $prefix
|
||||
}
|
||||
|
66
crates/nu-std/std/clip/mod.nu
Normal file
66
crates/nu-std/std/clip/mod.nu
Normal file
@ -0,0 +1,66 @@
|
||||
# Commands for interacting with the system clipboard
|
||||
#
|
||||
# > These commands require your terminal to support OSC 52
|
||||
# > Terminal multiplexers such as screen, tmux, zellij etc may interfere with this command
|
||||
|
||||
# Copy input to system clipboard
|
||||
@example "Copy a string to the clipboard" {
|
||||
"Hello" | clip copy
|
||||
}
|
||||
export def copy [
|
||||
--ansi (-a) # Copy ansi formatting
|
||||
]: any -> nothing {
|
||||
let input = $in | collect
|
||||
if not $ansi {
|
||||
$env.config.use_ansi_coloring = false
|
||||
}
|
||||
let text = match ($input | describe -d | get type) {
|
||||
$type if $type in [ table, record, list ] => {
|
||||
$input | table -e
|
||||
}
|
||||
_ => {$input}
|
||||
}
|
||||
|
||||
print -n $'(ansi osc)52;c;($text | encode base64)(ansi st)'
|
||||
}
|
||||
|
||||
# Paste contents of system clipboard
|
||||
@example "Paste a string from the clipboard" {
|
||||
clip paste
|
||||
} --result "Hello"
|
||||
export def paste []: [nothing -> string] {
|
||||
try {
|
||||
term query $'(ansi osc)52;c;?(ansi st)' -p $'(ansi osc)52;c;' -t (ansi st)
|
||||
} catch {
|
||||
error make -u {
|
||||
msg: "Terminal did not responds to OSC 52 paste request."
|
||||
help: $"Check if your terminal supports OSC 52."
|
||||
}
|
||||
}
|
||||
| decode
|
||||
| decode base64
|
||||
| decode
|
||||
}
|
||||
|
||||
# Add a prefix to each line of the content to be copied
|
||||
@example "Format output for Nushell doc" {
|
||||
[1 2 3] | clip prefix '# => '
|
||||
} --result "# => ╭───┬───╮
|
||||
# => │ 0 │ 1 │
|
||||
# => │ 1 │ 2 │
|
||||
# => │ 2 │ 3 │
|
||||
# => ╰───┴───╯
|
||||
# => "
|
||||
@example "Format output for Nushell doc and copy it" {
|
||||
ls | clip prefix '# => ' | clip copy
|
||||
}
|
||||
export def prefix [prefix: string]: any -> string {
|
||||
let input = $in | collect
|
||||
match ($input | describe -d | get type) {
|
||||
$type if $type in [ table, record, list ] => {
|
||||
$input | table -e
|
||||
}
|
||||
_ => {$input}
|
||||
}
|
||||
| str replace -r --all '(?m)(.*)' $'($prefix)$1'
|
||||
}
|
@ -37,11 +37,16 @@ def get-annotated [
|
||||
source `($file)`
|
||||
scope commands
|
||||
| select name attributes
|
||||
| where attributes != []
|
||||
| to nuon
|
||||
'
|
||||
| from nuon
|
||||
| update attributes { get name | each {|x| $valid_annotations | get -i $x } | first }
|
||||
| each {|e|
|
||||
# filter commands with test attributes, and map attributes to annotation name
|
||||
let test_attributes = $e.attributes.name | each {|x| $valid_annotations | get -i $x }
|
||||
if ($test_attributes | is-not-empty) {
|
||||
$e | update attributes $test_attributes.0
|
||||
}
|
||||
}
|
||||
| rename function_name annotation
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ authors = ["The Nushell Project Developers", "procs creators"]
|
||||
description = "Nushell system querying"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-system"
|
||||
name = "nu-system"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-table"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-table"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,13 +14,13 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.105.2" }
|
||||
nu-ansi-term = { workspace = true }
|
||||
fancy-regex = { workspace = true }
|
||||
tabled = { workspace = true, features = ["ansi"], default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.105.1" }
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.105.2" }
|
||||
|
@ -92,6 +92,16 @@ impl NuTable {
|
||||
self.count_cols
|
||||
}
|
||||
|
||||
pub fn create(text: String) -> NuRecordsValue {
|
||||
Text::new(text)
|
||||
}
|
||||
|
||||
pub fn insert_value(&mut self, pos: (usize, usize), value: NuRecordsValue) {
|
||||
let width = value.width() + indent_sum(self.config.indent);
|
||||
self.widths[pos.1] = max(self.widths[pos.1], width);
|
||||
self.data[pos.0][pos.1] = value;
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, pos: (usize, usize), text: String) {
|
||||
let text = Text::new(text);
|
||||
let width = text.width() + indent_sum(self.config.indent);
|
||||
@ -475,7 +485,8 @@ fn draw_table(
|
||||
truncate_table(&mut table, &t.config, width, termwidth);
|
||||
table_set_border_header(&mut table, head, &t.config);
|
||||
|
||||
table_to_string(table, termwidth)
|
||||
let string = table.to_string();
|
||||
Some(string)
|
||||
}
|
||||
|
||||
fn set_styles(table: &mut Table, styles: Styles, structure: &TableStructure) {
|
||||
@ -531,18 +542,6 @@ fn set_indent(table: &mut Table, indent: TableIndent) {
|
||||
table.with(Padding::new(indent.left, indent.right, 0, 0));
|
||||
}
|
||||
|
||||
fn table_to_string(table: Table, termwidth: usize) -> Option<String> {
|
||||
// Note: this is a "safe" path; presumable it must never happen cause we must made all the checks already
|
||||
// TODO: maybe remove it? I think so?
|
||||
let total_width = table.total_width();
|
||||
if total_width > termwidth {
|
||||
None
|
||||
} else {
|
||||
let content = table.to_string();
|
||||
Some(content)
|
||||
}
|
||||
}
|
||||
|
||||
struct WidthCtrl {
|
||||
width: WidthEstimation,
|
||||
trim_strategy: TrimStrategy,
|
||||
@ -915,7 +914,9 @@ fn truncate_columns_by_content(
|
||||
widths.push(trailing_column_width);
|
||||
width += trailing_column_width;
|
||||
|
||||
if widths.len() == 1 {
|
||||
let has_only_trail = widths.len() == 1;
|
||||
let is_enough_space = width <= termwidth;
|
||||
if has_only_trail || !is_enough_space {
|
||||
// nothing to show anyhow
|
||||
return WidthEstimation::new(widths_original, vec![], width, false, true);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ use std::cmp::max;
|
||||
use nu_color_config::{Alignment, StyleComputer, TextStyle};
|
||||
use nu_engine::column::get_columns;
|
||||
use nu_protocol::{Config, Record, ShellError, Span, Value};
|
||||
use tabled::grid::records::vec_records::Cell;
|
||||
|
||||
use crate::{
|
||||
NuTable, TableOpts, TableOutput,
|
||||
@ -186,13 +187,14 @@ fn expand_list(input: &[Value], cfg: Cfg<'_>) -> TableResult {
|
||||
.and_then(|val| val.get(INDEX_COLUMN_NAME))
|
||||
.map(|value| value.to_expanded_string("", cfg.opts.config))
|
||||
.unwrap_or_else(|| index.to_string());
|
||||
let index_width = string_width(&index_value);
|
||||
let index_value = NuTable::create(index_value);
|
||||
let index_width = index_value.width();
|
||||
if available_width <= index_width + extra_width + pad_width {
|
||||
// NOTE: we don't wanna wrap index; so we return
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
table.insert((row, 0), index_value);
|
||||
table.insert_value((row, 0), index_value);
|
||||
|
||||
index_column_width = max(index_column_width, index_width);
|
||||
}
|
||||
@ -241,9 +243,10 @@ fn expand_list(input: &[Value], cfg: Cfg<'_>) -> TableResult {
|
||||
.and_then(|val| val.get(INDEX_COLUMN_NAME))
|
||||
.map(|value| value.to_expanded_string("", cfg.opts.config))
|
||||
.unwrap_or_else(|| index.to_string());
|
||||
let index_width = string_width(&index_value);
|
||||
let index_value = NuTable::create(index_value);
|
||||
let index_width = index_value.width();
|
||||
|
||||
table.insert((row + 1, 0), index_value);
|
||||
table.insert_value((row + 1, 0), index_value);
|
||||
index_column_width = max(index_column_width, index_width);
|
||||
}
|
||||
|
||||
@ -294,11 +297,13 @@ fn expand_list(input: &[Value], cfg: Cfg<'_>) -> TableResult {
|
||||
|
||||
let inner_cfg = cfg_expand_reset_table(cfg.clone(), available);
|
||||
let cell = expand_entry_with_header(item, &header, inner_cfg);
|
||||
let value_width = string_width(&cell.text); // TODO: optimize cause when we expand we alrready know the width (most of the time or all)
|
||||
// TODO: optimize cause when we expand we alrready know the width (most of the time or all)
|
||||
let value = NuTable::create(cell.text);
|
||||
let value_width = value.width();
|
||||
|
||||
column_width = max(column_width, value_width);
|
||||
|
||||
table.insert((row + 1, column), cell.text);
|
||||
table.insert_value((row + 1, column), value);
|
||||
table.insert_style((row + 1, column), cell.style);
|
||||
|
||||
total_column_rows = total_column_rows.saturating_add(cell.size);
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-term-grid"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-term-grid"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -14,6 +14,6 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
|
||||
unicode-width = { workspace = true }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-test-suppor
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-test-support"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -15,9 +15,9 @@ bench = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
num-format = { workspace = true }
|
||||
which = { workspace = true }
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-utils"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-utils"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[[bin]]
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Nushell Config File
|
||||
#
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
$env.config.color_config = {
|
||||
separator: white
|
||||
leading_trailing_space_bg: { attr: n }
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Default Nushell Environment Config File
|
||||
# These "sensible defaults" are set before the user's `env.nu` is loaded
|
||||
#
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
|
||||
$env.PROMPT_COMMAND = {||
|
||||
let dir = match (do -i { $env.PWD | path relative-to $nu.home-path }) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Warning: This file is intended for documentation purposes only and
|
||||
# is not intended to be used as an actual configuration file as-is.
|
||||
#
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
#
|
||||
# A `config.nu` file is used to override default Nushell settings,
|
||||
# define (or import) custom commands, or run any other startup tasks.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Nushell Environment Config File Documentation
|
||||
#
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
#
|
||||
# Previously, environment variables were typically configured in `env.nu`.
|
||||
# In general, most configuration can and should be performed in `config.nu`
|
||||
|
@ -1,7 +1,7 @@
|
||||
# config.nu
|
||||
#
|
||||
# Installed by:
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
#
|
||||
# This file is used to override default Nushell settings, define
|
||||
# (or import) custom commands, or run any other startup tasks.
|
||||
|
@ -1,7 +1,7 @@
|
||||
# env.nu
|
||||
#
|
||||
# Installed by:
|
||||
# version = "0.105.1"
|
||||
# version = "0.105.2"
|
||||
#
|
||||
# Previously, environment variables were typically configured in `env.nu`.
|
||||
# In general, most configuration can and should be performed in `config.nu`
|
||||
|
@ -10,10 +10,10 @@ name = "nu_plugin_custom_values"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1", features = [] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2", features = [] }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
serde = { workspace = true }
|
||||
typetag = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.1" }
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.2" }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_exam
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_example"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[[bin]]
|
||||
name = "nu_plugin_example"
|
||||
@ -15,9 +15,9 @@ bench = false
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.2" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
|
@ -5,12 +5,12 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_form
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_formats"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
|
||||
indexmap = { workspace = true }
|
||||
eml-parser = "0.1"
|
||||
@ -20,4 +20,4 @@ plist = "1.7"
|
||||
chrono = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.1" }
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.2" }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_gsta
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -16,7 +16,7 @@ name = "nu_plugin_gstat"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
|
||||
git2 = "0.20"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_inc"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -16,7 +16,7 @@ name = "nu_plugin_inc"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", features = ["plugin"] }
|
||||
|
||||
semver = "1.0"
|
||||
|
@ -6,7 +6,7 @@
|
||||
# it also allows us to test the plugin interface with something manually implemented in a scripting
|
||||
# language without adding any extra dependencies to our tests.
|
||||
|
||||
const NUSHELL_VERSION = "0.105.1"
|
||||
const NUSHELL_VERSION = "0.105.2"
|
||||
const PLUGIN_VERSION = "0.1.1" # bump if you change commands!
|
||||
|
||||
def main [--stdio] {
|
||||
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_polars"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_polars"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -17,10 +17,10 @@ bench = false
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.105.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2" }
|
||||
|
||||
# Potential dependencies for extras
|
||||
chrono = { workspace = true, features = [
|
||||
@ -103,9 +103,9 @@ optional = false
|
||||
version = "0.48"
|
||||
|
||||
[dev-dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.1" }
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.1" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.105.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-command = { path = "../nu-command", version = "0.105.2" }
|
||||
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.105.2" }
|
||||
tempfile.workspace = true
|
||||
|
@ -1,14 +1,17 @@
|
||||
use crate::{
|
||||
PolarsPlugin,
|
||||
values::{Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject},
|
||||
values::{Column, CustomValueSupport, NuLazyFrame, NuLazyGroupBy, PolarsPluginObject},
|
||||
};
|
||||
|
||||
use crate::values::{NuDataFrame, NuExpression, utils::DEFAULT_ROWS};
|
||||
use crate::values::{NuDataFrame, NuExpression};
|
||||
use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand};
|
||||
use nu_protocol::{
|
||||
Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type,
|
||||
Value,
|
||||
};
|
||||
use polars::df;
|
||||
|
||||
const DEFAULT_ROWS: usize = 1;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LastDF;
|
||||
@ -62,6 +65,24 @@ impl PluginCommand for LastDF {
|
||||
example: "polars col a | polars last",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Aggregate the last values in the group.",
|
||||
example: "[[a b c d]; [1 0.5 true Apple] [2 0.5 true Orange] [2 4 true Apple] [3 10 false Apple] [4 13 false Banana] [5 14 true Banana]] | polars into-df -s {a: u8, b: f32, c: bool, d: str} | polars group-by d | polars last | polars sort-by [a] | polars collect",
|
||||
result: Some(
|
||||
NuDataFrame::new(
|
||||
false,
|
||||
df!(
|
||||
"d" => &["Orange", "Apple", "Banana"],
|
||||
"a" => &[2, 3, 5],
|
||||
"b" => &[0.50, 10.0, 14.0],
|
||||
"c" => &[true, false, true],
|
||||
|
||||
)
|
||||
.expect("dataframe creation should succeed"),
|
||||
)
|
||||
.into_value(Span::test_data()),
|
||||
),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@ -81,6 +102,9 @@ impl PluginCommand for LastDF {
|
||||
PolarsPluginObject::NuLazyFrame(lazy) => {
|
||||
command_lazy(plugin, engine, call, lazy).map_err(|e| e.into())
|
||||
}
|
||||
PolarsPluginObject::NuLazyGroupBy(groupby) => {
|
||||
command_groupby(plugin, engine, call, groupby).map_err(|e| e.into())
|
||||
}
|
||||
_ => {
|
||||
let expr = NuExpression::try_from_value(plugin, &value)?;
|
||||
let expr: NuExpression = expr.into_polars().last().into();
|
||||
@ -121,6 +145,20 @@ fn command_lazy(
|
||||
res.to_pipeline_data(plugin, engine, call.head)
|
||||
}
|
||||
|
||||
fn command_groupby(
|
||||
plugin: &PolarsPlugin,
|
||||
engine: &EngineInterface,
|
||||
call: &EvaluatedCall,
|
||||
groupby: NuLazyGroupBy,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let rows: Option<usize> = call.opt(0)?;
|
||||
let rows = rows.unwrap_or(DEFAULT_ROWS);
|
||||
let res = groupby.to_polars().tail(Some(rows));
|
||||
let res: NuLazyFrame = res.into();
|
||||
|
||||
res.to_pipeline_data(plugin, engine, call.head)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::test::test_polars_plugin_command;
|
||||
|
@ -27,7 +27,7 @@ import sys
|
||||
import json
|
||||
|
||||
|
||||
NUSHELL_VERSION = "0.105.1"
|
||||
NUSHELL_VERSION = "0.105.2"
|
||||
PLUGIN_VERSION = "0.1.1" # bump if you change commands!
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_quer
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_query"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -16,8 +16,8 @@ name = "nu_plugin_query"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2" }
|
||||
|
||||
gjson = "0.8"
|
||||
scraper = { default-features = false, version = "0.23" }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_stre
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_stress_internals"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
[[bin]]
|
||||
name = "nu_plugin_stress_internals"
|
||||
|
@ -5,15 +5,15 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nuon"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nuon"
|
||||
version = "0.105.1"
|
||||
version = "0.105.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.1", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.1", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.1", default-features = false }
|
||||
nu-parser = { path = "../nu-parser", version = "0.105.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
|
||||
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
|
||||
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
chrono = { workspace = true }
|
||||
|
@ -856,6 +856,36 @@ fn overlay_hide_renamed_overlay() {
|
||||
assert!(actual_repl.err.contains("external_command"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlay_hide_restore_hidden_env() {
|
||||
let inp = &[
|
||||
"$env.foo = 'bar'",
|
||||
"overlay new aa",
|
||||
"hide-env foo",
|
||||
"overlay hide aa",
|
||||
"$env.foo",
|
||||
];
|
||||
|
||||
let actual_repl = nu!(nu_repl_code(inp));
|
||||
|
||||
assert_eq!(actual_repl.out, "bar");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlay_hide_dont_restore_hidden_env_which_is_introduce_currently() {
|
||||
let inp = &[
|
||||
"overlay new aa",
|
||||
"$env.foo = 'bar'",
|
||||
"hide-env foo", // hide the env in overlay `aa`
|
||||
"overlay hide aa",
|
||||
"'foo' in $env",
|
||||
];
|
||||
|
||||
let actual_repl = nu!(nu_repl_code(inp));
|
||||
|
||||
assert_eq!(actual_repl.out, "false");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlay_hide_and_add_renamed_overlay() {
|
||||
let inp = &[
|
||||
|
@ -242,6 +242,29 @@ fn test_alternate_config_path() {
|
||||
assert_eq!(actual.out, env_path.to_string_lossy().to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_last_config_path() {
|
||||
let config_file = "crates/nu-utils/src/default_files/scaffold_config.nu";
|
||||
let env_file = "crates/nu-utils/src/default_files/scaffold_env.nu";
|
||||
|
||||
let cwd = std::env::current_dir().expect("Could not get current working directory");
|
||||
|
||||
let config_path =
|
||||
nu_path::canonicalize_with(config_file, &cwd).expect("Could not get config path");
|
||||
let actual = nu!(
|
||||
cwd: &cwd,
|
||||
format!("nu --config non-existing-path --config another-random-path.nu --config {config_path:?} -c '$nu.config-path'")
|
||||
);
|
||||
assert_eq!(actual.out, config_path.to_string_lossy().to_string());
|
||||
|
||||
let env_path = nu_path::canonicalize_with(env_file, &cwd).expect("Could not get env path");
|
||||
let actual = nu!(
|
||||
cwd: &cwd,
|
||||
format!("nu --env-config non-existing-path --env-config {env_path:?} -c '$nu.env-path'")
|
||||
);
|
||||
assert_eq!(actual.out, env_path.to_string_lossy().to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_xdg_config_empty() {
|
||||
Playground::setup("xdg_config_empty", |_, playground| {
|
||||
|
@ -279,6 +279,18 @@ fn path_argument_dont_auto_expand_if_double_quoted() -> TestResult {
|
||||
run_test(r#"def spam [foo: path] { echo $foo }; spam "~/aa""#, "~/aa")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn path_argument_dont_make_absolute_if_unquoted() -> TestResult {
|
||||
#[cfg(windows)]
|
||||
let expected = "..\\bar";
|
||||
#[cfg(not(windows))]
|
||||
let expected = "../bar";
|
||||
run_test(
|
||||
r#"def spam [foo: path] { echo $foo }; spam foo/.../bar"#,
|
||||
expected,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dont_allow_implicit_casting_between_glob_and_string() -> TestResult {
|
||||
let _ = fail_test(
|
||||
|
Reference in New Issue
Block a user