I'm using Vagrant, Chef solo and berkshelf to run up a Linux VM on Windows 7 using VirtualBox.
Cookbooks are downloaded from git and arrive with windows line endings. One of these is a Perl script, which is then uploaded to the vm and executed. However it fails because the first line is
#!/usr/bin/perl
and the Linux VM sees this as the command
#!/usr/bin/perl^M
How can I configure whichever tool needs it (probably Chef?) to download .pl files in Unix format?
Well, it seems it's too late to fix things at this point with configuration settings
The algorithm used by
git
is follows:The setting controlling whether this logic is applied or not is called core.autocrlf
So to finally solve the problem you should prepare your repository to be "cross-platform", i.e. re-index the files in all (necessary) commits so that they are put into the index as "converted text files". Is it a public repository in which existing commits shouldn't be modified or not? The recipe how to fix things depends on the "publicity".
You need to decide what is more important for you:
Here's the recipe for both methods.