nushell/scripts/build-all.nu
zc he 44b7cfd696
refactor: tree-sitter-nu friendly alternative expressions (#15301)
# Description

Choose more tree-sitter-nu-friendly (if not better) expressions in nu
scripts.
The changes made in this PR all come from known issues of
`tree-sitter-nu`.

1. nested single/double quotes:
https://github.com/nushell/tree-sitter-nu/issues/125
2. module path of `use` command:
https://github.com/nushell/tree-sitter-nu/issues/165
3. where predicates of boolean column:
https://github.com/nushell/tree-sitter-nu/issues/177
4. `error make` keyword:
https://github.com/nushell/tree-sitter-nu/issues/179

Those issues are either hard to fix or "not planned" for syntactical
precision considerations ATM.

# User-Facing Changes

Should be none

# Tests + Formatting

# After Submitting
2025-03-12 08:48:19 -05:00

42 lines
958 B
Plaintext

use std/log warning
print '-------------------------------------------------------------------'
print 'Building nushell (nu) and all the plugins'
print '-------------------------------------------------------------------'
warning "./scripts/build-all.nu will be deprecated, please use the `toolkit build` command instead"
let repo_root = ($env.CURRENT_FILE | path dirname --num-levels 2)
def build-nushell [] {
print $'(char nl)Building nushell'
print '----------------------------'
cd $repo_root
cargo build --locked
}
def build-plugin [] {
let plugin = $in
print $'(char nl)Building ($plugin)'
print '----------------------------'
cd $'($repo_root)/crates/($plugin)'
cargo build
}
let plugins = [
nu_plugin_inc,
nu_plugin_gstat,
nu_plugin_query,
nu_plugin_example,
nu_plugin_custom_values,
nu_plugin_formats,
nu_plugin_polars
]
for plugin in $plugins {
$plugin | build-plugin
}