Skip to content

Instantly share code, notes, and snippets.

@colinwren
Created April 3, 2013 02:36
Show Gist options
  • Select an option

  • Save colinwren/5298008 to your computer and use it in GitHub Desktop.

Select an option

Save colinwren/5298008 to your computer and use it in GitHub Desktop.
Grunt.log.error question
Desired CoffeeScript compilation Error:
>> SyntaxError: unmatched }
>> In file: main.coffee
>> On line: 15
>> foo = } bar
>> ^
The isssue is that grunt.log.error trims whitespace so that
grunt.log.error(' ^')
appears as
>> ^
instead of
>> ^
Is there a way to maintain this whitespace without using a non-whitespace character to prevent the trimming?
@colinwren
Copy link
Author

Both log.error and log.warn trim the input string. I ended up using grunt.log.writeln (which doesn't trim the string) and added in the red >> to make it look like grunt.log.error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment