Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rake "sh" does not echo command

938 views
Skip to first unread message

Brock Rycenga

unread,
Oct 22, 2008, 10:37:57 AM10/22/08
to

From what I have read, I would expect the ruby/rake "sh" command to echo
the system call to STDOUT - instead just executing it. Is there some
reason why ruby/rake would not be echoing my system commands to my
command window? I am running in Windows. Here is an example:

rule ".#{OBJ_EXT}" => lambda{|objfile| find_source(objfile)} do |t|
puts "Building object file for #{t.source}"
sh "#{COMPILER} #{C_OPTS} #{C_OBJ_DIR} #{C_INC_PATHS} #{C_FLAGS}
#{C_TARGET} #{t.source}"
end

The execution of the above rule never echoes the command following "sh".
Why is that? Is there another shell command I should be using? I realize
that I could just precede everything with a puts of the same line, but
it seems like I am missing something.


Thanks.
--
Posted via http://www.ruby-forum.com/.

Patrick Doyle

unread,
Oct 22, 2008, 11:13:59 AM10/22/08
to
[Note: parts of this message were removed to make it a legal post.]

I always add:

# I like to see the shell commands as they are executed
verbose(true)

to my rakefiles. You can also do things like:

vebose(true) do
sh this_verbose_command
end

or

verbose(false) do
sh that_quiet_command
end

The default is not to echo the commands. My Makefile heritage finds this
odd, but now that I've figured out how to get around it, it's not so odd
anymore.

There might even be a .rakerc file somewhere I could add that to. Hmmm...
if not, then perhaps I have finally come up with an idea that I could
implement and contribute back.

--wpd

Brock Rycenga

unread,
Oct 22, 2008, 11:23:09 AM10/22/08
to

Thanks Patrick.


Patrick Doyle wrote:
> I always add:
>
> # I like to see the shell commands as they are executed
> verbose(true)
>

--
Posted via http://www.ruby-forum.com/.

0 new messages