Does mimosa have a --no-color option?

22 views
Skip to first unread message

akau...@gmail.com

unread,
Feb 12, 2015, 10:48:57 AM2/12/15
to mimo...@googlegroups.com
I have setup mimosa as an external builder under eclipse in a Windows 7 64-bit system. Upon execution, I receive weird characters (possibly used to change colors on the console). Apparently, eclipse's console doesn't recognize these color characters and prints them as question mark enclosed in boxes (not sure how Google Groups will show these characters on a browser).

C:\Windows\System32\cmd.exe /c mimosa build & exit

10:39:57 - Info - Beginning build
10:39:57 - Info - mimosa-combine: Deleted file [36mpublic\css\styles.css [0m
10:39:58 - [32mSuccess [0m - Deleted file [36mpublic\login.html [0m
10:39:58 - [32mSuccess [0m - Deleted file [36mpublic\index.html [0m
10:39:58 - [32mSuccess [0m - Deleted file [36mpublic\index-optimize.html [0m
...

I was wondering if mimosa has a --no-color option.

Something like this:
C:\Windows\System32\cmd.exe /c mimosa --no-color build & exit

I am expecting to see an output like this:
10:39:57 - Info - Beginning build
10:39:57 - Info - mimosa-combine: Deleted file [36mpublic\css\styles.css[0m
10:39:58 - [32mSuccess[0m - Deleted file [36mpublic\login.html[0m
10:39:58 - [32mSuccess[0m - Deleted file [36mpublic\index.html[0m
10:39:58 - [32mSuccess[0m - Deleted file [36mpublic\index-optimize.html[0m
...

Ameet

Ameet Kaustav

unread,
Feb 12, 2015, 11:00:21 AM2/12/15
to mimo...@googlegroups.com
Google groups stripped off the weird characters. I am attaching a screenshot of the eclipse console here.

Ameet
EclipseConsole.png

dbashford

unread,
Feb 12, 2015, 10:51:52 PM2/12/15
to mimo...@googlegroups.com
Hey!

So the logger has color options

http://mimosa.io/configuration.html#growl

If you set each color to null, you should disable all colors.

So, something like this:

logger: {
  warn: {
    color: null
  },
  success: {
    color: null
  },
  error: {
    color: null
  },
  debug: {
    color: null
 },
  embeddedText: {
    color: null
  },

I should note, that this config only takes effect for log messages AFTER all the mimosa configuration has validated successfully.  So, if your mimosa-config is broken, bad JSON or something like that, the colors will appear.

Hope that helps!

Ameet Kaustav

unread,
Feb 13, 2015, 3:28:34 PM2/13/15
to mimo...@googlegroups.com
Thanks, it worked! I created a profiles folder in my project and placed an eclipse.coffee file in it - contents of the file below:

exports.config =
  logger
:
    warn
:
      color
: null
    success
:
      color
: null
    error
:
      color
: null
    debug
:
      color
: null
    embeddedText
:
      color
: null



And I called it using the following command:

C:\Windows\System32\cmd.exe /c mimosa build --profile eclipse & exit


Works like a charm! Following output was generated:

15:20:46 - Info - Beginning build
15:20:46 - Info - Applying build profiles: eclipse
15:20:47 - Success - Wrote file public\index.html
15:20:47 - Success - Wrote file public\index-optimize.html
...


Ameet

GMail

unread,
Feb 13, 2015, 3:41:51 PM2/13/15
to mimo...@googlegroups.com
Awesome!

And excellent use of profiles!

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "mimosajs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mimosajs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ameet Kaustav

unread,
Mar 27, 2015, 9:07:31 AM3/27/15
to mimo...@googlegroups.com
Like I mentioned before, I am trying to execute mimosa from within eclipse. I have an external eclipse builder to invoke mimosa on every save (Ctrl + S) operation. My command being:

C:\Windows\System32\cmd.exe /c mimosa build --profile eclipse & exit

And the profile file at <project>\profiles\eclipse.coffee looks like the following:

exports.config =
  logger
:
    info
:
      color
: null

    warn
:
      color
: null
    success
:
      color
: null
    error
:
      color
: null
    debug
:
      color
: null
    embeddedText
:
      color
: null


I constantly ran into a problem when I remove files from the project and it mimosa doesn't clean the public output folder completely and leaves those files behind. After more reading and re-reading, I found the following on http://mimosa.io/commands.html for mimosa clean:

Force Asset Deletion (-f/--force)

Because the clean command will not remove anything inwatch.compiledDir that isn't in watch.sourceDir, Mimosa may leave behind code.

$ mimosa clean --force
$ mimosa clean -f

If mimosa watch is running and a file is deleted or renamed, Mimosa cleans out the compiled version of that file, but if Mimosa is not running and a file is deleted or removed, Mimosa has no way of knowing the files left behind are safe for cleaning.

So, I modified my initial external builder command to invoke to the following:

C:\Windows\System32\cmd.exe /c mimosa clean --force --profile eclipse & mimosa build --profile eclipse & exit

Here is a minor issue which I am facing: The logger output contains only 1 line of code which doesn't take my profile settings into consideration (See attached screenshot). My questions:

1. Is there a better way to invoke the clean command before the build happens? Something on the lines of:
$ mimosa clean --profile eclipse build --profile eclipse

2. Is this one line with the weird characters an expected behavior? Or do I need more profile settings?
09:39:54 - Info - Did not find compiled directory [36mpublic[0m, so making it for you

Ameet
mimosa-2.png

Ameet Kaustav

unread,
Jul 26, 2015, 2:27:58 PM7/26/15
to mimosajs, akau...@gmail.com
Any thoughts on my questions here?

Ameet
Reply all
Reply to author
Forward
0 new messages