Fixup for removal of "joins" and "splits".

* Migrate epm

* Fix docs
This commit is contained in:
Qi Xiao 2020-08-16 17:29:09 +01:00
parent 7d1c6cf5ec
commit d5736120e5
2 changed files with 10 additions and 10 deletions

View File

@ -66,7 +66,7 @@ fn -package-domain [pkg]{
} }
fn -package-without-domain [pkg]{ fn -package-without-domain [pkg]{
str:split &max=2 / $pkg | drop 1 | joins '' str:split &max=2 / $pkg | drop 1 | str:join ''
} }
# Merge two maps # Merge two maps
@ -269,7 +269,7 @@ fn query [pkg]{
if (not (has-value $special-keys $key)) { if (not (has-value $special-keys $key)) {
val = $data[$key] val = $data[$key]
if (eq (kind-of $val) list) { if (eq (kind-of $val) list) {
val = (joins ", " $val) val = (str:join ", " $val)
} }
echo (styled (-first-upper $key)":" blue) $val echo (styled (-first-upper $key)":" blue) $val
} }
@ -286,7 +286,7 @@ fn installed {
# without conflicts. # without conflicts.
if $cfg { if $cfg {
lvl = $cfg[levels] lvl = $cfg[levels]
pat = '^\Q'$-lib-dir'/\E('(repeat (+ $lvl 1) '[^/]+' | joins '/')')/$' pat = '^\Q'$-lib-dir'/\E('(repeat (+ $lvl 1) '[^/]+' | str:join '/')')/$'
put (each [d]{ re:find $pat $d } [ $-lib-dir/$dom/**[nomatch-ok]/ ] )[groups][1][text] put (each [d]{ re:find $pat $d } [ $-lib-dir/$dom/**[nomatch-ok]/ ] )[groups][1][text]
} }
} }
@ -313,7 +313,7 @@ fn install [&silent-if-installed=$false @pkgs]{
metadata = (metadata $pkg) metadata = (metadata $pkg)
if (has-key $metadata dependencies) { if (has-key $metadata dependencies) {
deps = $metadata[dependencies] deps = $metadata[dependencies]
-info "Installing dependencies: "(joins " " $deps) -info "Installing dependencies: "(str:join " " $deps)
# If the installation of dependencies fails, uninstall the # If the installation of dependencies fails, uninstall the
# target package (leave any already-installed dependencies in # target package (leave any already-installed dependencies in
# place) # place)

View File

@ -251,13 +251,13 @@ func fromUtf8Bytes(nums ...int) (string, error) {
// Joins inputs with `$sep`. Examples: // Joins inputs with `$sep`. Examples:
// //
// ```elvish-transcript // ```elvish-transcript
// ~> put lorem ipsum | joins , // ~> put lorem ipsum | str:join ,
// ▶ lorem,ipsum // ▶ lorem,ipsum
// ~> joins , [lorem ipsum] // ~> str:join , [lorem ipsum]
// ▶ lorem,ipsum // ▶ lorem,ipsum
// ~> joins '' [lorem ipsum] // ~> str:join '' [lorem ipsum]
// ▶ loremipsum // ▶ loremipsum
// ~> joins '...' [lorem ipsum] // ~> str:join '...' [lorem ipsum]
// ▶ lorem...ipsum // ▶ lorem...ipsum
// ``` // ```
// //
@ -336,10 +336,10 @@ func replace(opts maxOpt, old, repl, s string) string {
// codepoints. // codepoints.
// //
// ```elvish-transcript // ```elvish-transcript
// ~> splits , lorem,ipsum // ~> str:split , lorem,ipsum
// ▶ lorem // ▶ lorem
// ▶ ipsum // ▶ ipsum
// ~> splits '' 你好 // ~> str:split '' 你好
// ▶ 你 // ▶ 你
// ▶ 好 // ▶ 好
// ``` // ```