Add appendFile helper function to append if content doesn't already exist.