Automatic add
This commit is contained in:
parent
4eb338bc82
commit
f9ca2c81b7
54
.bashrc
54
.bashrc
|
@ -14,8 +14,56 @@ alias push='git push origin master ; git push gitea master'
|
|||
alias francinette=/nfs/homes/tischmid/francinette/tester.sh
|
||||
alias paco=/nfs/homes/tischmid/francinette/tester.sh
|
||||
alias norm='alacritty -e sh -c '\''git rev-parse --show-toplevel || { echo "Exiting in 5" ; sleep 1 ; echo "Exiting in 4" ; sleep 1 ; echo "Exiting in 3" ; sleep 1 ; echo "Exiting in 2" ; sleep 1 ; echo "Exiting in 1" ; sleep 1 ; } && cd "$(git rev-parse --show-toplevel)" && watch -cn.5 date \&\& norminette -R CheckForbiddenSourceHeader'\'' & disown'
|
||||
# alias zellij='zellij options --disable-mouse-mode'
|
||||
alias z='zellij'
|
||||
alias AH='cd /nfs/homes/tischmid/repos/42cursus/libft'
|
||||
alias z='\zellij options --disable-mouse-mode'
|
||||
alias zellij='\zellij options --disable-mouse-mode'
|
||||
|
||||
__ftest_file () {
|
||||
file="${1}"
|
||||
tmp_dir="${2}"
|
||||
|
||||
test_file_name="$($(type -P basename) -- "${file%.c}_test.c")"
|
||||
test_file="$(find "${tmp_dir}" -name "${test_file_name}" -type f)"
|
||||
if [ -z "${test_file}" ]; then
|
||||
printf '\033[31m%s\033[m\n' "No test file for file '${file}'"
|
||||
return 1
|
||||
fi
|
||||
${test_file}
|
||||
}
|
||||
|
||||
ftest () {
|
||||
err="0"
|
||||
if [ -z "${tmp_dir}" ]; then
|
||||
tmp_dir="$(mktemp -dt -- '42tests-tischmid.XXXXXXXX')"
|
||||
git clone --quiet 'https://git.timo.one/42berlin/42tests-tischmid.git' "${tmp_dir}"
|
||||
fi
|
||||
if [ -z "${@}" ]; then
|
||||
for file in $(find . -mindepth 1 -type f -name '*.c'); do
|
||||
__ftest_file "${file}" "${tmp_dir}" || err="1"
|
||||
done
|
||||
else
|
||||
while [ -z "${1}" ]; do
|
||||
if [ -f "${1}" ]; then
|
||||
__ftest_file "${1}" "${tmp_dir}" || err="1"
|
||||
else
|
||||
printf '\033[31m%s\033[m\n' "File ${1} does not exist"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
fi
|
||||
rm -rf -- "/tmp/42tests-tischmid.*"
|
||||
unset -v -- "tmp_dir"
|
||||
return -- "${err}"
|
||||
}
|
||||
|
||||
dapt () {
|
||||
ACTION="${1}"
|
||||
shift
|
||||
CMD="RUN apt ${ACTION} -yy ${@}"
|
||||
echo "${CMD}" >> ~/repos-other/docker/Dockerfile
|
||||
docker build -t ubuntu-bloated ~/repos-other/docker/
|
||||
docker rmi $(docker images -f "dangling=true" -q) 2>/dev/null
|
||||
}
|
||||
|
||||
norminette () {
|
||||
version="$($(type -P norminette) -v | cut -d" " -f2)"
|
||||
|
@ -284,3 +332,5 @@ clone42 () {
|
|||
printf '%s\n' "Could not clone repo!"
|
||||
fi
|
||||
}
|
||||
|
||||
export MAIL='timo42@proton.me'
|
||||
|
|
Loading…
Reference in New Issue