-
-
Save ferventcoder/1107920 to your computer and use it in GitHub Desktop.
@echo off | |
SET DIR=%~dp0% | |
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "& '%DIR%setup.ps1' %*" | |
pause |
### install chocolatey ### | |
iex ((new-object net.webclient).DownloadString("http://chocolatey.org/install.ps1")) | |
# install nuget and ruby if they are missing | |
cinstm nuget.commandline | |
cinstm ruby | |
#perform ruby updates and get gems | |
gem update --system | |
gem install rake | |
gem install bundler | |
#restore the nuget packages | |
$nugetConfigs = Get-ChildItem '.\' -Recurse | ?{$_.name -match "packages\.config"} | select | |
foreach ($nugetConfig in $nugetConfigs) { | |
Write-Host "restoring packages from $($nugetConfig.FullName)" | |
nuget install $($nugetConfig.FullName) /OutputDirectory packages | |
} | |
rake |
Slick! Another variant would be one that would download psake and setup a PowerShell build (maybe using uppercut/roundhouse?). This might fit well as I'm looking at making Tree Surgeon (http://treesurgeon.codeplex.com/) into a choclately project. Then you could create a new project from scratch with all the fixins'
cinst psake
Yes, the dependency chain is where uppercut is going. I have plans to take it there as well.
More good stuff here: https://github.com/chocolatey/chocolatey/wiki/DevelopmentEnvironmentSetup
The one in the wiki has added a bit of user interaction with default answers after a timeout so they can be run unattended.
More updated example here: https://gist.github.com/ferventcoder/3825023
I'm new to Ruby, and am confused by this this part of the script:
#restore the nuget packages
$nugetConfigs = Get-ChildItem '.\' -Recurse | ?{$_.name -match "packages\.config"} | select
foreach ($nugetConfig in $nugetConfigs) {
Write-Host "restoring packages from $($nugetConfig.FullName)"
nuget install $($nugetConfig.FullName) /OutputDirectory packages
}
Is this for a ruby development environment that is using nuget to manage the gems? I would think that a recursive call to Bundler would be more common. Or is this for some other purpose?
This does the following: