fix cli-bridge on windows

pull/85/head
nightwing 2015-05-01 12:13:47 +04:00
rodzic a5104cab08
commit e2f087d41b
3 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -21,7 +21,9 @@ define(function(require, exports, module) {
// var emit = plugin.getEmitter();
var counter = 0;
var SOCKET = c9.home + "/.c9/bridge.socket";
var SOCKET = process.platform == "win32"
? "\\\\.\\pipe\\"+ process.env.HOME +"\\.c9\\bridge.socket"
: process.env.HOME + "/.c9/bridge.socket";
/***** Methods *****/

Wyświetl plik

@ -4,8 +4,10 @@ module.exports = function (vfs, options, register) {
var net = require("net");
var Stream = require('stream');
var SOCKET = process.env.HOME + "/.c9/bridge.socket";
var SOCKET = process.platform == "win32"
? "\\\\.\\pipe\\"+ process.env.HOME +"\\.c9\\bridge.socket"
: process.env.HOME + "/.c9/bridge.socket";
function createListenClient(api){
var client = net.connect(SOCKET, function(data){
if (data) api.onData(data);

Wyświetl plik

@ -2,7 +2,7 @@
define(function(require, exports, module) {
main.consumes = [
"Plugin", "bridge", "tabManager", "panels", "tree.favorites", "tree",
"fs", "preferences", "settings"
"fs", "preferences", "settings", "c9"
];
main.provides = ["bridge.commands"];
return main;
@ -16,6 +16,7 @@ define(function(require, exports, module) {
var settings = imports.settings;
var favs = imports["tree.favorites"];
var fs = imports.fs;
var c9 = imports.c9;
var prefs = imports.preferences;
var async = require("async");
@ -68,11 +69,13 @@ define(function(require, exports, module) {
function open(message, callback) {
var i = -1;
var tabs = [];
BASEPATH = c9.toInternalPath(BASEPATH);
async.each(message.paths, function(info, next) {
var path = info.path;
i++;
path = c9.toInternalPath(path);
// Make sure file is inside workspace
if (path.charAt(0) !== "~") {
if (path.substr(0, BASEPATH.length) !== BASEPATH)