From 16595fcd89e321b894ace5a40f5bf526004e19ce Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 10 Jun 2023 16:07:38 -0700 Subject: [PATCH] forgot some legacy cleanup --- sheclang | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/sheclang b/sheclang index 8124708..5b2321a 100755 --- a/sheclang +++ b/sheclang @@ -17,7 +17,11 @@ # Public Domain (y'all really care?) set -e -export IFS=$'\n' +#O_IFS=${IFS} +#export IFS=$'\n' + +COMPILER="clang++" +BUILD_FLAGS=() ## Phase 1: Input Collection & Argument Checking if [[ $# -lt 1 ]]; then @@ -25,6 +29,21 @@ if [[ $# -lt 1 ]]; then exit fi +# Load a global configuartion for a user +if [[ -e $HOME/.config/sheclang/config ]]; then + source $HOME/.config/sheclang/config +elif [[ -e $HOME/.sheclang ]]; then + source $HOME/.sheclang +fi + +# Load a project specific config +if [[ -e $PWD/sheclang.conf ]]; then + source $PWD/sheclang.conf +elif [[ -e $PWD/.sheclang ]]; then + source $PWD/.sheclang +fi +#echo ${BUILD_FLAGS[@]} + file_input="$1" target_dir="$(dirname "${file_input}")" @@ -55,7 +74,8 @@ file_output="${target_dir}/${file_output}" shift # remove the source file from the BASH argument tree. # Runn my prefered build script. Customize to your tastes -clang++ -o "$file_output" "$file_input_corrected" +#$COMPILER ${BUILD_FLAGS[@]} -o "$file_output" "$file_input_corrected" +$COMPILER -o "$file_output" "$file_input_corrected" ${BUILD_FLAGS[@]} # And execute with the remaining arguments -"$file_output" $* \ No newline at end of file +"$file_output" $*