fix bug that caused line-endings not to get appended to the end of files correctly

Signed-off-by: Chris Granger <ibdknox@gmail.com>