Update build and install scripts (#4733)

* Update build and install scripts

* Add build-all.nu and uninstall-all.sh
This commit is contained in:
Justin Ma 2022-03-05 13:10:33 +08:00 committed by GitHub
parent 9c17c73d5f
commit bc119a5e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 11 deletions

View File

@ -1,31 +1,31 @@
#!/bin/sh
echo "-------------------------------------------------------------------"
echo "Building nushell (nu.exe) with --features=extra and all the plugins"
echo "-------------------------------------------------------------------"
echo "---------------------------------------------------------------"
echo "Building nushell (nu) with --features=extra and all the plugins"
echo "---------------------------------------------------------------"
echo ""
echo "Building nushell.exe"
echo "Building nushell"
cargo build --features=extra
echo ""
cd crates/nu_plugin_example
echo "Building nu_plugin_example.exe"
echo "Building nu_plugin_example"
cargo build
echo ""
cd ../../crates/nu_plugin_gstat
echo "Building nu_plugin_gstat.exe"
echo "Building nu_plugin_gstat"
cargo build
echo ""
cd ../../crates/nu_plugin_inc
echo "Building nu_plugin_inc.exe"
echo "Building nu_plugin_inc"
cargo build
echo ""
cd ../../crates/nu_plugin_query
echo "Building nu_plugin_query.exe"
echo "Building nu_plugin_query"
cargo build
echo ""

22
build-all.nu Normal file
View File

@ -0,0 +1,22 @@
echo '-------------------------------------------------------------------'
echo 'Building nushell (nu) with --features=extra and all the plugins'
echo '-------------------------------------------------------------------'
echo $'(char nl)Building nushell'
echo '----------------------------'
cargo build --features=extra
let plugins = [
nu_plugin_inc,
nu_plugin_gstat,
nu_plugin_query,
nu_plugin_example,
]
for plugin in $plugins {
$'(char nl)Building ($plugin)'
'----------------------------'
cd $'crates/($plugin)'
cargo build
ignore
}

View File

@ -1,3 +0,0 @@
#!/bin/sh
cargo install --path . --features=extra

18
install-all-feats.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
cargo install --path . --features=extra
NU_PLUGINS=(
'nu_plugin_inc'
'nu_plugin_gstat'
'nu_plugin_query'
'nu_plugin_example'
)
for plugin in "${NU_PLUGINS[@]}"
do
echo ''
echo "----------------------------------------------"
echo "Install plugin $plugin from local..."
echo "----------------------------------------------"
cd crates/$plugin && cargo install --path . && cd ../../
done

19
uninstall-all.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
echo ''
echo "----------------------------------------------"
echo "Uninstall nu and all plugins from cargo/bin..."
echo "----------------------------------------------"
NU_PLUGINS=(
'nu_plugin_inc'
'nu_plugin_gstat'
'nu_plugin_query'
'nu_plugin_example'
)
cargo uninstall nu
for plugin in "${NU_PLUGINS[@]}"
do
cargo uninstall $plugin
done