Created
April 28, 2011 03:31
-
-
Save davidalpert/945744 to your computer and use it in GitHub Desktop.
use rake to kickstart IIS Express
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :kickstart_iisexpress do | |
# this task is a workaround for the following issue: http://stackoverflow.com/questions/4605750/iis-express-from-command-line | |
path_to_iisExpress = File.join(tools_path, 'IIS Express', 'iisexpress.exe') | |
output = IO.popen(path_to_iisExpress) do |pipe| | |
sleep 3 #seconds | |
Process.kill("KILL", pipe.pid) | |
pipe.close | |
end | |
puts 'IIS Express successfully kickstarted.' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :kickstart_iisexpress do | |
# this task is a workaround for the following issue: http://stackoverflow.com/questions/4605750/iis-express-from-command-line | |
puts 'starting IIS Express w/ no arguments to make sure it runs...' | |
path_to_iisExpress = File.join(tools_path, 'IIS Express', 'iisexpress.exe') | |
output = IO.popen(path_to_iisExpress) do |pipe| | |
'IIS Express started'.split(//).each do |c| | |
putc c | |
end | |
(1..5).each do | |
sleep 1 #seconds | |
putc '.' | |
end | |
Process.kill("KILL", pipe.pid) | |
out = pipe.read | |
pipe.close | |
puts 'IIS Express stopped; output was:' | |
puts | |
out | |
end | |
puts output | |
puts | |
puts 'IIS Express successfully kickstarted.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment