chore: load env, echo messages, generate install_nu_plugins.nu

This commit is contained in:
Jesús Pérex 2025-06-27 03:38:27 +01:00
parent 841a6d40fa
commit 32edf72302
3 changed files with 42 additions and 9 deletions

View File

@ -1,7 +1,12 @@
#!/usr/bin/env bash
TARGET_PATH=distribution
ORG=$(pwd)
[ -r env ] && . ./env
cd $TARGET_PATH
./collect.sh
cp -pv nu_plugin* /usr/local/bin
[ -z "$TARGET_PATH" ] && echo "Check env values && exit 1
[ -z "$INSTALL_BIN_PATH" ] && echo "Check env values && exit 1
cd $TARGET_PATH || exit 1
[ -x collect-install.sh ] && ./collect-install.sh
cd $ORG || exit 1

33
distribution/collect-install.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
[ -r ../env ] && . ../env
[ -r env ] && . ./env
[ -z "$INSTALL_FILE" ] && echo "Check env values && exit 1
[ -z "$INSTALL_BIN_PATH" ] && echo "Check env values && exit 1
echo "------------------------------"
echo "Collect binaries from $TARGET_PATH ... "
echo "------------------------------"
[ -r ../nushell/target/release/nu ] && cp -v ../nushell/target/release/nu .
cp -v ../nu_plugin_*/target/release/nu_plugin_* .
rm -f nu_plugin_*.d
echo "------------------------------"
echo "Generate installer for nushell in $INSTALL_FILE ..."
echo "------------------------------"
echo "#!/usr/bin/env nu" > $INSTALL_FILE
for plgn in $(ls -d nu_plugin_*)
do
echo "plugin add $INSTALL_BIN_PATH/$plgn ">>$INSTALL_FILE
echo "$plgn"
done
chmod +x $INSTALL_FILE
echo "------------------------------"
echo "Install nu plugins in $INSTALL_BIN_PATH ..."
echo "------------------------------"
cp -pv nu_plugin* $INSTALL_BIN_PATH

View File

@ -1,5 +0,0 @@
#!/bin/bash
cp -v ../nushell/target/release/nu .
cp -v ../nu_plugin_*/target/release/nu_plugin_* .
rm -f nu_plugin_*.d