dingjie / atom-sync

Atom package to sync files bidirectionally between remote host and local over ssh+rsync
MIT License
59 stars 32 forks source link

Arom 1.18.0 x64 not showing in treeview right-click menu. #69

Open hvisage opened 7 years ago

hvisage commented 7 years ago

Hi there,

Having trouble with this plugin since 1.18.0 x84 upgrade on MacOSX, as I can't see the sync to/from options in the menus when right clicking on the treeview files/folders.

IT seems to still be able to "sync on save", but I need the sync folder option up and down

ayurmedia commented 7 years ago

css has changed, the menu needs new css selector to show the "sync" entry in menu. its broken since 1.17 and 1.18

you can try my forked plugin atom-sync-cygwin which has a patch for the menu. it works with mac and windows.

hvisage commented 7 years ago

@ayurmedia Thank you, will test :)

ayurmedia commented 7 years ago

@plizt on windows 10 it does not work out of the box, because the rsync-command (if available at all) has problems with path like "c:/project/" and interprets c: as user or server etc.

if you want to use it on windows you can use cygwin, follow instructions here: https://atom.io/packages/atom-sync-cygwin

atom-sync only works on mac (maybe linux) which has ssh + rsync native. atom-sync-cygwin also works on windows when cygwin is configured correctly. c:/project is translated to /cygdrive/c/project which then works also on windows. because its a unix-style folder. atom-sync-cygwin is still compatible on mac (i use same plugin on windows and osx)

hvisage commented 7 years ago

Thanks @ayurmedia ! Works for me on MacOSX

rubycut commented 7 years ago

@ayurmedia , for me , edit config option doesn't work.

ayurmedia commented 7 years ago

@rubycut , this also happens to me, i think in atom 1.18 something changed, it was working in 1.16.

workaround is to put a .sync-config.cson in the root folder of your project and copy the sample config.

remote:
      host: "HOSTNAME",
      user: "USERNAME",
      path: "REMOTE_DIR"
    behaviour:
      uploadOnSave: true
      syncDownOnOpen: true
      forgetConsole: false
      autoHideConsole: true
      alwaysSyncAll: false
    option:
      deleteFiles: false
      exclude: [
        '.sync-config.cson'
        '.git'
        'node_modules'
        'tmp'
        'vendor'
      ]

has somebody a tipp why it might not work ?

{
        'label': 'Edit Sync Config'
        'command': 'atom-sync-cygwin:configure'
   }

in menus/atom-sync.cson is there and gets called but its not executed in lib/helper/config-helper.coffee .

configure maybe calls 'initialize' which should create and open the file in atom editor pane:

 initialise: (f) ->
    config = @getConfigPath f
    if not fs.isFileSync config
      csonSample = cson.stringify @sample
      fs.writeFileSync config, csonSample
    atom.workspace.open config

there is the sample, defined. configFileName seems to be correct. and @getConfigPath should return the project-folder.

There is no error in Developer / console.

Maybe before was implicit trigger of "initialize" by "configure" , which is now missing.

ayurmedia commented 7 years ago

@rubycut: "edit config" is fixed in "atom-sync-cygwin" , (update to version 0.9.10 or higher)

@subscriptions.add atom.commands.add '.tree-view .full-menu .header.list-item', 'atom-sync-cygwin:configure': (e) =>
      @controller.onCreate @getSelectedPath e.target

the css selector had to be corrected in the lib/controller/atom-sync* file also

Here seems to be the cause of the trouble: https://github.com/atom/tree-view/commit/a654ac76f8600e75e1bb2a9bb41879e0bb08dc9c

somebody changed the structure of the context-menu and the query-selectors need to be changed:

.tree-view is now a parent div, and was a class on the context-menu- items itself before it seems.

adding a space inside ".tree-view .full-menu" solves all the troubles. /s Good thing it was clearly documented in the update-log of Atom 1.17 and 1.18 ;)

...

also the place where the "Sync" Menu appears seems totally random. i have no idea how to move it near the "New File / New Folder" like in 1.16. its a bit annoying to search for it all the time.

... TL/DR: the "configure" command was not executed because the query-selector in controller was wrong, the rest of the code was fine.

ayurmedia commented 7 years ago

oh there was a solution already here: https://github.com/dingjie/atom-sync/issues/61 but never added to this "atom-sync" master. seems @dingjie is on a long vacation.

w-barath commented 7 years ago

I've submitted a pull request for 1.19.1 to enable the menus as well.

see pull request #74, just needed to update the css selectors.

ayurmedia commented 7 years ago

seems @dingjie is not maintaining the project any more.

you can switch to https://atom.io/packages/atom-sync-cygwin which is a fork of this plugin, but also working with windows (cygwin) and has small bugfixes.