diff --git a/lib/ex.coffee b/lib/ex.coffee index 3231748..f77a9f4 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -1,6 +1,7 @@ path = require 'path' +fs = require 'fs-plus' + CommandError = require './command-error' -fs = require 'fs' trySave = (func) -> deferred = Promise.defer() @@ -36,8 +37,9 @@ saveAs = (filePath) -> fs.writeFileSync(filePath, editor.getText()) getFullPath = (filePath) -> + filePath = fs.normalize filePath return filePath if path.isAbsolute(filePath) - return path.join(atom.project.getPath(), filePath) + return path.join(atom.project.getPaths()[0], filePath) replaceGroups = (groups, replString) -> arr = replString.split('') diff --git a/package.json b/package.json index 3364f3e..6960bb2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "underscore-plus": "1.x", "event-kit": "^0.7.2", "space-pen": "^5.1.1", - "atom-space-pen-views": "^2.0.4" + "atom-space-pen-views": "^2.0.4", + "fs-plus": "^2.2.8" }, "consumedServices": { "vim-mode": {