Use Symfony FileSystem to write script file