Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing condition that tests if the given `path` is absolute or relative.

  • Loading branch information...
commit 8541e838d71203283a785b272e2195724d10c03b 1 parent 5dc2292
@arboleya arboleya authored
Showing with 7 additions and 9 deletions.
  1. +4 −5 lib/toaster.js
  2. +3 −4 src/toaster/toast.coffee
View
9 lib/toaster.js
@@ -95,7 +95,7 @@ var toaster = exports.toaster = {};
}
Toast.prototype.toast = function(srcpath, params) {
- var alias, builder, config, debug, dir, folder, i, item, v, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
+ var alias, builder, config, debug, dir, folder, i, item, v, vpath, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
if (params == null) {
params = {};
}
@@ -137,9 +137,8 @@ var toaster = exports.toaster = {};
_ref7 = config.vendors;
for (i = _i = 0, _len = _ref7.length; _i < _len; i = ++_i) {
v = _ref7[i];
- if ((path.resolve(v)) === !(path.join(this.basepath, v))) {
- config.vendors[i] = path.resolve(v);
- } else {
+ vpath = config.vendors[i] = path.resolve(v);
+ if ((path.resolve(vpath)) !== vpath) {
config.vendors[i] = path.join(this.basepath, v);
}
}
@@ -154,7 +153,7 @@ var toaster = exports.toaster = {};
_ref8 = params.folders;
for (folder in _ref8) {
alias = _ref8[folder];
- if (path.resolve(folder !== path)) {
+ if ((path.resolve(folder)) !== folder) {
folder = path.join(this.basepath, folder);
}
config.src_folders.push({
View
7 src/toaster/toast.coffee
@@ -102,9 +102,8 @@ class Toast
# compute vendors full path
for v, i in config.vendors
- if (path.resolve v) is not (path.join @basepath, v)
- config.vendors[i] = path.resolve v
- else
+ vpath = config.vendors[i] = (path.resolve v)
+ if (path.resolve vpath) isnt vpath
config.vendors[i] = path.join @basepath, v
unless srcpath instanceof Object
@@ -115,7 +114,7 @@ class Toast
if params.folders?
for folder, alias of params.folders
- if path.resolve folder != path
+ if (path.resolve folder) != folder
folder = path.join @basepath, folder
config.src_folders.push {path: folder, alias: alias}
Please sign in to comment.
Something went wrong with that request. Please try again.