From b7fcbfdc1f9143e0613adc1d1da383ac1ff5e0ea Mon Sep 17 00:00:00 2001 From: pumuckly Date: Fri, 6 Jan 2017 15:21:15 +0100 Subject: [PATCH 1/4] Update for Windows symlink Added option to check correct project path for files when use symlink (mklink) on Windows. For this, a new method added: loadReal, which try to determine the correct project root path with localRoot configure options. To use it just set "config.option.localRoot" at the config file. --- lib/helper/config-helper.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/helper/config-helper.coffee b/lib/helper/config-helper.coffee index d301919..fe357e9 100644 --- a/lib/helper/config-helper.coffee +++ b/lib/helper/config-helper.coffee @@ -18,6 +18,18 @@ module.exports = ConfigHelper = return if not config or not fs.isFileSync config cson.readFileSync config + loadReal: (f) -> + config = @load f + if config + config.filename = f + else + for fRealPath in atom.project.getPaths() + if (f.indexOf fRealPath) is -1 + config = cson.readFileSync fRealPath + '/' + @configFileName + if config and (f.indexOf config?.option?.localRoot) isnt -1 + config.filename = fRealPath + f.substr config.option.localRoot.length + config + assert: (f) -> config = @load f if not config then throw new Error "You must create remote config first" From 199f9e05e18f74ebc5c9f883dd469815c7db9cbf Mon Sep 17 00:00:00 2001 From: pumuckly Date: Fri, 6 Jan 2017 15:31:17 +0100 Subject: [PATCH 2/4] Update for Windows symlink Added option to check correct project path for files when use symlink (mklink) on Windows. For this, a new method added: loadReal, which try to determine the correct project root path with localRoot configure options. To use it just set "config.option.localRoot" at the config file. --- lib/controller/service-controller.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/controller/service-controller.coffee b/lib/controller/service-controller.coffee index c0217b2..1361dab 100644 --- a/lib/controller/service-controller.coffee +++ b/lib/controller/service-controller.coffee @@ -27,12 +27,12 @@ module.exports = ServiceController = @config.initialise obj onSave: (obj) -> - config = @config.load obj - @onSync obj, 'up' if config?.behaviour?.uploadOnSave + config = @config.loadReal obj + @onSync config.filename, 'up' if config?.behaviour?.uploadOnSave onOpen: (obj) -> - config = @config.load obj - @onSync obj, 'down' if config?.behaviour?.syncDownOnOpen + config = @config.loadReal obj + @onSync config.filename, 'down' if config?.behaviour?.syncDownOnOpen onSync: (obj, direction) -> obj = path.normalize obj From b07ea710e113fe1096db08d872ccb37293e9447a Mon Sep 17 00:00:00 2001 From: pumuckly Date: Fri, 6 Jan 2017 15:34:13 +0100 Subject: [PATCH 3/4] Update for Windows symlink Added option to check correct project path for files when use symlink (mklink) on Windows. For this, a new method added: loadReal, which try to determine the correct project root path with localRoot configure options. To use it just set "config.option.localRoot" at the config file. --- lib/helper/config-helper.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/helper/config-helper.coffee b/lib/helper/config-helper.coffee index fe357e9..e32f9c3 100644 --- a/lib/helper/config-helper.coffee +++ b/lib/helper/config-helper.coffee @@ -64,6 +64,7 @@ module.exports = ConfigHelper = alwaysSyncAll: false option: deleteFiles: false + localRoot: false exclude: [ '.sync-config.cson' '.git' From 5bc34a0bd12a809c94b3de4d1784047ac30f13c2 Mon Sep 17 00:00:00 2001 From: pumuckly Date: Fri, 6 Jan 2017 16:07:21 +0100 Subject: [PATCH 4/4] Find in files bugfix on Windows The "path" not exists at find in all files function --- lib/controller/service-controller.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/controller/service-controller.coffee b/lib/controller/service-controller.coffee index 1361dab..023f5ba 100644 --- a/lib/controller/service-controller.coffee +++ b/lib/controller/service-controller.coffee @@ -35,9 +35,8 @@ module.exports = ServiceController = @onSync config.filename, 'down' if config?.behaviour?.syncDownOnOpen onSync: (obj, direction) -> - obj = path.normalize obj - try + obj = path.normalize obj config = @config.assert obj catch err @console.show()