Skip to content
Browse files

Prepending `alias` with a slash / bask-slash (depending on the OS) in…

… order to follow the standard - internally every file starts with "/".
  • Loading branch information...
1 parent 788d81e commit 151477304bc41ba12fc2e51fce7f8fded36da668 @arboleya committed
Showing with 18 additions and 8 deletions.
  1. +1 −1 README.md
  2. +3 −0 build/CHANGELOG.md
  3. +6 −2 lib/toaster.js
  4. +1 −1 package.json
  5. +7 −4 src/toaster/core/builder.coffee
View
2 README.md
@@ -1,7 +1,7 @@
![Coffee Toaster](http://github.com/serpentem/coffee-toaster/blob/0.5.0/images/toaster.png?raw=true)
Minimalist build system for CoffeeScript.
-> Version 0.6.9
+> Version 0.6.10
[![Build Status](https://secure.travis-ci.org/serpentem/coffee-toaster.png)](http://travis-ci.org/serpentem/coffee-toaster)
View
3 build/CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
+## 0.6.10 - 12/24/2012
+ * Fixing aliases again, now in Builder class
+
## 0.6.9 - 12/22/2012
* Fixing path's evaluation also when aliases are in use
View
8 lib/toaster.js
@@ -862,7 +862,11 @@ var toaster = exports.toaster = {};
}
fpath = f.location;
spath = src.path;
- falias = src.alias || "";
+ if (src.alias != null) {
+ falias = path.sep + src.alias;
+ } else {
+ falias = '';
+ }
include = true;
_ref1 = this.exclude;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
@@ -873,7 +877,7 @@ var toaster = exports.toaster = {};
return;
}
type = StringUtil.titleize(f.type);
- relative_path = f.location.replace(spath, falias);
+ relative_path = fpath.replace(spath, falias);
now = (("" + (new Date)).match(/[0-9]{2}\:[0-9]{2}\:[0-9]{2}/))[0];
switch (ev) {
case "create":
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "coffee-toaster",
- "version": "0.6.9",
+ "version": "0.6.10",
"author": "Anderson Arboleya <anderson@arboleya.me>",
"description": "Minimalist build system for CoffeeScript.",
"keywords": ["coffeescript", "build", "namespace", "tool"],
View
11 src/toaster/core/builder.coffee
@@ -157,25 +157,28 @@ class Builder
watcher.on 'delete', (FnUtil.proxy @on_fs_change, src, 'delete')
on_fs_change:(src, ev, f)=>
-
# skip all folder creation
return if f.type == "dir" and ev == "create"
# folder path and alias
fpath = f.location
spath = src.path
- falias = src.alias || ""
+ if src.alias?
+ falias = (path.sep + src.alias)
+ else
+ falias = ''
# check if it's from some excluded folder
include = true
- include &= !(new RegExp( item ).test fpath) for item in @exclude
+ for item in @exclude
+ include &= !(new RegExp( item ).test fpath)
return unless include
# Titleize the type for use in the log messages bellow
type = StringUtil.titleize f.type
# relative filepath (with alias, if informed)
- relative_path = f.location.replace spath, falias
+ relative_path = fpath.replace spath, falias
# date for CLI notifications
now = ("#{new Date}".match /[0-9]{2}\:[0-9]{2}\:[0-9]{2}/)[0]

0 comments on commit 1514773

Please sign in to comment.
Something went wrong with that request. Please try again.