1
0
Fork 0
2022-untitled-game/tools/scripts/header_generator.sh

28 lines
431 B
Bash
Executable File

#!/usr/bin/env bash
output=$1
echo -e "#pragma once\n" > $output
for input in "${@:2}";
do
name=$(basename $input | sed -r 's/\./_/g')
contents="const char* ${name} = \""
while read -r line;
do
if [[ $line == *"#"* ]] || [[ $line == *"//"* ]];
then
contents="${contents}\\n$line\\n"
else
contents="${contents}$line"
fi
done < "$input"
echo "$contents\";" >> $output
echo >> $output
done
echo >> $output