added tagfile and make use of it in modules
This commit is contained in:
@@ -211,6 +211,23 @@ patchfile()
|
||||
unset rights dstfile
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Put a small header in a file showing it have been automatically modified
|
||||
tagfile()
|
||||
{
|
||||
for f in $@; do
|
||||
local text="# File automatically modified by init.sh on $(stdtime)."
|
||||
if [[ -e $f ]]; then
|
||||
sed -i "1s/^/$text\n/" $f
|
||||
else
|
||||
echo $text > $f
|
||||
sed -i -e "s/modified/generated/" $f
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# check a file exists and return error if not
|
||||
file_exists()
|
||||
|
||||
Reference in New Issue
Block a user