Skip to content

Commit

Permalink
Apply Dir.chdir to build deamon spawn as well
Browse files Browse the repository at this point in the history
  • Loading branch information
rwz committed Jan 8, 2015
1 parent b00f02f commit 82a39f6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/ember-cli/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ def initialize(name, options={})

def compile
prepare
silence_stream STDOUT do
Dir.chdir app_path do
system(env_hash, command, err: :out)
end
end
silence_stream(STDOUT){ exec command }
end

def run
prepare
@pid = spawn(env_hash, command(watch: true), chdir: app_path, err: :out)
cmd = command(watch: true)
@pid = exec(cmd, method: :spawn)
at_exit{ stop }
end

Expand Down Expand Up @@ -215,5 +212,13 @@ def env_hash
vars.store "SUPPRESS_JQUERY", "true" if suppress_jquery?
end
end

def exec(cmd, options={})
method_name = options.fetch(:method, :system)

Dir.chdir app_path do
Kernel.public_send(method_name, env_hash, cmd, err: :out)
end
end
end
end

0 comments on commit 82a39f6

Please sign in to comment.