Skip to content

Commit

Permalink
Fixed complied files not being renamed on Windows (see jescalan#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcehunter committed Apr 9, 2015
1 parent 4294c48 commit 2ae3cd8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ os = require('os')
###

class Config
###*
* This is an escaped version of the platform specific path seperator to be
* used in regular expressions. It is defined as a (derived) constant,
* because the path seperator does not change over the course of a run.
###

PATH_SEPERATOR_REGEXP_STRING = path.sep.replace '\\', '\\\\'

###*
* Creates a new instance of the roots config. This happens once, as soon as
Expand Down Expand Up @@ -141,10 +148,7 @@ class Config
res.unshift(@output_path())
res = res.join(path.sep)
if ext
if (os.platform() is 'win32')
res = res.replace(///\.[^\#{path.sep}]*$///, ".#{ext}")
else
res = res.replace(///\.[^#{path.sep}]*$///, ".#{ext}")
res = res.replace(///\.[^#{PATH_SEPERATOR_REGEXP_STRING}]*$///, ".#{ext}")
res

###*
Expand Down

0 comments on commit 2ae3cd8

Please sign in to comment.