Call replace only for files.

issue #codio-4042
https://codio.myjetbrains.com/youtrack/issue/codio-4042
files = _.isArray(files) ? files : [files]; it is an array