Skip to content
Cory Metcalfe edited this page Mar 24, 2016 · 7 revisions

When you require 'albacore' you will get a few methods added and available for use within your Rakefile, these are specified in CrossPlatformCmd, and are as follows:

  • #system (see fuller doc below)
  • #sh : same as above
  • #shie : same as above
  • #which : (binaryName : string) -> (path : string)
  • #normalise_slashes - takes a path-looking string and normalises the slashes to the operating system that the command is running on. So for Windows, you'd get back-slashes and for linux forward slashes.
  • #chdir (work_dir : ?string) (block : Block<unit, x>) : x - takes a string work dir to be in and a block of ruby to execute in that work dir and returns the return value of block.

Calling #system

Signature: system(cmd, [cmd args], [Hash(opts)], [block|ok,status| => bool]) => (ok : bool)|| output

returns false if system command was `ok == false or if bad exit code

otherwise returns or the output as a string

#system example

system 'tools/nunit-console.exe', 'my.dll', clr_command: true

This will run the 'bash script':

mono tools/nunit-console.exe my.dll

on unix, and without mono on Windows.

Clone this wiki locally