File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,11 @@ task :watch do
60
60
compassPid = Process . spawn ( "compass watch" )
61
61
62
62
trap ( "INT" ) {
63
- Process . kill ( 9 , jekyllPid )
64
- Process . kill ( 9 , compassPid )
65
- exit 0
63
+ [ jekyllPid , compassPid ] . each { |pid | Process . kill ( 9 , pid ) rescue Errno ::ESRCH }
64
+ exit 0
66
65
}
67
66
68
- Process . wait
67
+ [ jekyllPid , compassPid ] . each { | pid | Process . wait ( pid ) }
69
68
end
70
69
71
70
desc "preview the site in a web browser"
@@ -77,13 +76,11 @@ task :preview do
77
76
rackupPid = Process . spawn ( "rackup --port #{ server_port } " )
78
77
79
78
trap ( "INT" ) {
80
- Process . kill ( 9 , jekyllPid )
81
- Process . kill ( 9 , compassPid )
82
- Process . kill ( 9 , rackupPid )
83
- exit 0
79
+ [ jekyllPid , compassPid , rackupPid ] . each { |pid | Process . kill ( 9 , pid ) rescue Errno ::ESRCH }
80
+ exit 0
84
81
}
85
82
86
- Process . wait
83
+ [ jekyllPid , compassPid , rackupPid ] . each { | pid | Process . wait ( pid ) }
87
84
end
88
85
89
86
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
You can’t perform that action at this time.
0 commit comments