Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster bddab2e9f8 setupenv: Add tool directories to PATH, be more verbose
No more `bin/tools/hexnet -4t 9000`. Just `hexnet -4t 9000` now.
2022-08-16 13:55:42 +02:00
BodgeMaster 017c8a61f8 scripts/tools/arraydump: New tool added
Never again will you need to manually convert binary data into an array!
This tool does it for you! Get it now for only $99! Limited availability!

To process data from stdin / a pipe, just pass `-` as the file name.
2022-08-16 13:40:50 +02:00
2 changed files with 34 additions and 2 deletions

25
scripts/tools/arraydump.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2022, FOSS-VG Developers and Contributers
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# version 3 along with this program.
# If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
if [ -z "$1" ]; then
echo -e "Usage: $0 FILE\n\nRead FILE and print its contents to standard output formatted as array of hexadecimal numbers."
exit 1
fi
echo -n "{"
xxd -p $1 | tr -d '\n\r' | sed -e 's/../0x&, /g;s/, $//'
echo "}"

View File

@ -13,9 +13,10 @@
# version 3 along with this program.
# If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
echo -n "Loading shell environment for FOSS-VG development... "
echo ">>> Loading shell environment for FOSS-VG development..."
PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
echo "Project base directory is $PROJECT_BASE_DIR"
alias clean="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean.sh; popd >/dev/null 2>&1"
alias clean_dependencies="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean_dependencies.sh; popd >/dev/null 2>&1"
@ -33,15 +34,21 @@ function build {
popd >/dev/null 2>&1
}
echo "Added aliases and functions."
export PATH="$PROJECT_BASE_DIR/bin/tools:$PROJECT_BASE_DIR/scripts/tools:$PATH"
echo "PATH is $PATH"
if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib
else
export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib:"$LD_LIBRARY_PATH"
fi
echo "LD_LIBRARY_PATH is $LD_LIBRARY_PATH"
if [ -f "$PROJECT_BASE_DIR/.localenv.bashrc" ]; then
source "$PROJECT_BASE_DIR/.localenv.bashrc"
echo "Loaded local environment customizations."
fi
echo "done."
echo ">>> Done."