From 3d53a6ecf842dc7ec7b34accac8257affc0b2c59 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 12 Jun 2013 15:32:25 -0700 Subject: [PATCH] Remove internal references to .base() --- src/stdlib/fs-utils.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stdlib/fs-utils.coffee b/src/stdlib/fs-utils.coffee index 9e6ebaa40..904e6f370 100644 --- a/src/stdlib/fs-utils.coffee +++ b/src/stdlib/fs-utils.coffee @@ -4,6 +4,7 @@ mkdirp = require 'mkdirp' Module = require 'module' async = require 'async' rimraf = require 'rimraf' +Path = require 'path' module.exports = # Make the given path absolute by resolving it against the @@ -26,7 +27,7 @@ module.exports = # parent directory if the file is a directory. A terminal directory # separator is ignored. directory: (path) -> - parentPath = path.replace(new RegExp("/#{@base(_.escapeRegExp(path))}\/?$"), '') + parentPath = path.replace(new RegExp("/#{Path.basename(_.escapeRegExp(path))}\/?$"), '') return "" if path == parentPath parentPath @@ -40,7 +41,7 @@ module.exports = # extension exists. extension: (path) -> return '' unless typeof path is 'string' - match = @base(path).match(/\.[^\.]+$/) + match = Path.basename(path).match(/\.[^\.]+$/) if match match[0] else @@ -309,7 +310,7 @@ module.exports = isReadmePath: (path) -> extension = @extension(path) - base = @base(path, extension).toLowerCase() + base = Path.basename(path, extension).toLowerCase() base is 'readme' and (extension is '' or @isMarkdownExtension(extension)) readPlist: (path) ->