modify file to write only when has diff [ci skip]