Call replace only for files.

issue #codio-4042
https://codio.myjetbrains.com/youtrack/issue/codio-4042
What if  `files` is not an array?