Skip to content
Snippets Groups Projects

Draft: Resolve "Implementation of new nodes creation"

Open Joan Vallvé Navarro requested to merge 454-implementation-of-new-nodes-creation into devel
1 file
+ 13
7
Compare changes
  • Side-by-side
  • Inline
+ 13
7
@@ -120,10 +120,12 @@ fi
@@ -120,10 +120,12 @@ fi
# DETECT FIRST AND LAST LICENSE LINES
# DETECT FIRST AND LAST LICENSE LINES
sed -i -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' $license #remove empty lines at the beginning and at the end
sed -i -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' $license #remove empty lines at the beginning and at the end
line_start_mark=$(head -n 1 $license) #"//--------LICENSE_START--------"
line_start_mark=$(head -n 1 $license)
line_end_mark=$(tail -n 1 $license) #"//--------LICENSE_END--------"
line_end_mark=$(tail -n 1 $license)
 
exclude_mark="// This is not part of WOLF"
echo "line_start: $line_start_mark"
echo "line_start: $line_start_mark"
echo "line_end: $line_end_mark"
echo "line_end: $line_end_mark"
 
echo "excluding files starting with: $exlude_mark"
# PATH (AND tmp FOLDER)
# PATH (AND tmp FOLDER)
folder=$path
folder=$path
@@ -169,12 +171,16 @@ if [ "$mode" == "add" ]; then
@@ -169,12 +171,16 @@ if [ "$mode" == "add" ]; then
echo "Recursively adding license header to all files (.c, .cpp, .h, .hpp):"
echo "Recursively adding license header to all files (.c, .cpp, .h, .hpp):"
for i in $file_list
for i in $file_list
do
do
if grep -m1 -Fxq "${line_start_mark}" $i; then
if grep -m1 -Fxq "${exlude_mark}" $i; then
:
echo "excluding ${i} since it contains exclude mark"
else
else
echo " - ${i}"
if grep -m1 -Fxq "${line_start_mark}" $i; then
( cat ${license}; cat $i ) > temp_file
:
mv temp_file $i
else
 
echo " - ${i}"
 
( cat ${license}; cat $i ) > temp_file
 
mv temp_file $i
 
fi
fi
fi
done
done
fi
fi
Loading