mirror of
https://github.com/opensiriusfox/bashrc.d.git
synced 2025-06-17 04:40:32 -07:00
Added logo protection to the build script
This commit is contained in:
parent
9549062157
commit
66c0d8e7e4
2 changed files with 45 additions and 0 deletions
33
0-builder
33
0-builder
|
@ -3,6 +3,26 @@ export IFS=$'\n'
|
||||||
|
|
||||||
BASHRC_D="$HOME/.bashrc.d"
|
BASHRC_D="$HOME/.bashrc.d"
|
||||||
COMPILED_SRC="$BASHRC_D/1-compiled"
|
COMPILED_SRC="$BASHRC_D/1-compiled"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Setup the default build functions
|
||||||
|
export __BUILDER__WORKING_DIR="$BASHRC_D"
|
||||||
|
function __builder_prebuild { :; }
|
||||||
|
function __builder_postbuild { :; }
|
||||||
|
|
||||||
|
__builder_prebuild_exec() {
|
||||||
|
pushd $__BUILDER__WORKING_DIR >/dev/null; printf '\e[34m';
|
||||||
|
( __builder_prebuild; )
|
||||||
|
printf '\e[0m'; popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
__builder_postbuild_exec() {
|
||||||
|
pushd $__BUILDER__WORKING_DIR >/dev/null; printf '\e[34m'
|
||||||
|
( __builder_postbuild; )
|
||||||
|
printf '\e[0m'; popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
echo "Rebuilding $COMPILED_SRC"
|
echo "Rebuilding $COMPILED_SRC"
|
||||||
|
|
||||||
echo """#!/bin/bash
|
echo """#!/bin/bash
|
||||||
|
@ -10,6 +30,17 @@ echo """#!/bin/bash
|
||||||
|
|
||||||
""" > $COMPILED_SRC
|
""" > $COMPILED_SRC
|
||||||
|
|
||||||
|
|
||||||
|
HOST_SPECIFIC_META_SRC="$BASHRC_D/hostname/$(hostname).meta.sh"
|
||||||
|
if [[ -e $HOST_SPECIFIC_META_SRC ]]; then
|
||||||
|
echo "Executing host specific config file $HOST_SPECIFIC_META_SRC"
|
||||||
|
source "$HOST_SPECIFIC_META_SRC"
|
||||||
|
else
|
||||||
|
echo "No host specific file found at $HOST_SPECIFIC_META_SRC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
__builder_prebuild_exec
|
||||||
|
|
||||||
SELF_SRC=$(readlink -f $0)
|
SELF_SRC=$(readlink -f $0)
|
||||||
for F in $(find $BASHRC_D -maxdepth 1 -iname "*.sh"); do
|
for F in $(find $BASHRC_D -maxdepth 1 -iname "*.sh"); do
|
||||||
echo " Building in $F"
|
echo " Building in $F"
|
||||||
|
@ -32,6 +63,7 @@ else
|
||||||
echo "No host specific file found at $HOST_SPECIFIC_SRC"
|
echo "No host specific file found at $HOST_SPECIFIC_SRC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "##################" >> $COMPILED_SRC
|
echo "##################" >> $COMPILED_SRC
|
||||||
echo "# Reloader Script" >> $COMPILED_SRC
|
echo "# Reloader Script" >> $COMPILED_SRC
|
||||||
echo """##################
|
echo """##################
|
||||||
|
@ -40,3 +72,4 @@ function __rebuild_bashrcd() {
|
||||||
}
|
}
|
||||||
""" >> $COMPILED_SRC
|
""" >> $COMPILED_SRC
|
||||||
|
|
||||||
|
__builder_postbuild_exec
|
||||||
|
|
12
hostname/kusanagi.meta.sh
Normal file
12
hostname/kusanagi.meta.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
export IFS=$'\n'
|
||||||
|
|
||||||
|
__builder_prebuild() {
|
||||||
|
set -x
|
||||||
|
ln -s logos/tachikoma-ref-b.png.sh ./logo.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
__builder_postbuild() {
|
||||||
|
set -x
|
||||||
|
unlink logo.sh
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue