Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yongkangchen/remote-sync
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.1.5
Choose a base ref
...
head repository: yongkangchen/remote-sync
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 16 commits
  • 6 files changed
  • 4 contributors

Commits on May 21, 2017

  1. Copy the full SHA
    941f16a View commit details

Commits on May 22, 2017

  1. Fix q.drain bug (#374)

    dschwen committed May 22, 2017
    2
    Copy the full SHA
    c328bee View commit details

Commits on Jun 3, 2017

  1. Merge pull request #400 from levythu/master

    Add tree view menu support for Atom 1.17.0
    elistone authored Jun 3, 2017
    Copy the full SHA
    ff25fcb View commit details

Commits on Sep 10, 2017

  1. Fixed CSS Selectors for ContextMenu

    Issue materialised circa Atom update 1.19.7
    daverickdunn authored Sep 10, 2017
    Copy the full SHA
    3e804cb View commit details
  2. Merge pull request #1 from daverickdunn/daverickdunn-patch-ContextMenu

    Fixed CSS Selectors for ContextMenu
    daverickdunn authored Sep 10, 2017
    Copy the full SHA
    94661ee View commit details

Commits on Oct 14, 2017

  1. Copy the full SHA
    083b6cf View commit details
  2. Merge pull request #446 from daverickdunn/master

    Context Menu Fix
    daverickdunn authored Oct 14, 2017
    Copy the full SHA
    c7dc03d View commit details
  3. Copy the full SHA
    aae437e View commit details
  4. Merge pull request #447 from daverickdunn/master

    reverted package version (to use apm auto-increment instead...)
    daverickdunn authored Oct 14, 2017
    Copy the full SHA
    32d9070 View commit details
  5. Prepare 4.1.6 release

    daverickdunn committed Oct 14, 2017
    Copy the full SHA
    3432d52 View commit details

Commits on Oct 24, 2017

  1. Added selector for project root. Added configure to file context. Mov…

    …ed configure to bottom of list in file/folder contexts.
    daverickdunn committed Oct 24, 2017
    Copy the full SHA
    ee1f637 View commit details
  2. Prepare 4.1.7 release

    daverickdunn committed Oct 24, 2017
    Copy the full SHA
    27c5214 View commit details
  3. Merge pull request #402 from dschwen/qdrain_374

    Fix q.drain bug
    daverickdunn authored Oct 24, 2017
    Copy the full SHA
    b374620 View commit details

Commits on Oct 26, 2017

  1. Copy the full SHA
    770f926 View commit details
  2. Copy the full SHA
    3d79ea1 View commit details
  3. Prepare 4.1.8 release

    daverickdunn committed Oct 26, 2017
    Copy the full SHA
    2d99ad9 View commit details
Showing with 24 additions and 12 deletions.
  1. +1 −1 README.md
  2. +6 −1 index.coffee
  3. +6 −3 lib/RemoteSync.coffee
  4. +5 −2 lib/model/host.coffee
  5. +5 −4 menus/context.cson
  6. +1 −1 package.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Atom Remote Sync](http://i.imgur.com/xBqYanL.png)

# Atom Remote Sync [![Atom.io](https://img.shields.io/badge/Atom.io-1.7.3-40A977.svg)](https://atom.io) [![GitHub stars](https://img.shields.io/github/stars/yongkangchen/remote-sync.svg)](https://github.com/yongkangchen/remote-sync/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/yongkangchen/remote-sync/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/yongkangchen/remote-sync.svg)](https://github.com/yongkangchen/remote-sync/issues)
# Atom Remote Sync [![Atom.io](https://img.shields.io/badge/Atom.io-1.21.1-40A977.svg)](https://atom.io) [![GitHub stars](https://img.shields.io/github/stars/yongkangchen/remote-sync.svg)](https://github.com/yongkangchen/remote-sync/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/yongkangchen/remote-sync/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/yongkangchen/remote-sync.svg)](https://github.com/yongkangchen/remote-sync/issues)

Use SFTP and FTP features inside Atom, having the ability to upload and download files directly from inside Atom.

7 changes: 6 additions & 1 deletion index.coffee
Original file line number Diff line number Diff line change
@@ -90,7 +90,11 @@ module.exports =

activate: (state) ->
projectDict = {}
initProject(atom.project.getPaths())
try
initProject(atom.project.getPaths())
catch
atom.notifications.addError "RemoteSync Error",
{dismissable: true, detail: "Failed to initalise RemoteSync"}

CompositeDisposable ?= require('atom').CompositeDisposable
disposables = new CompositeDisposable
@@ -139,6 +143,7 @@ module.exports =
disposables.add onDidSave
disposables.add onDidDestroy


deactivate: ->
disposables.dispose()
disposables = null
9 changes: 6 additions & 3 deletions lib/RemoteSync.coffee
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ class RemoteSync
constructor: (@projectPath, @configPath) ->
Host ?= require './model/host'

@host = new Host(@configPath)
@host = new Host(@configPath, getLogger())
watchFiles = @host.watch?.split(",").filter(Boolean)
@projectPath = path.join(@projectPath, @host.source) if @host.source
if watchFiles?
@@ -112,6 +112,7 @@ class RemoteSync
uploadFolder: (dirPath)->
fs.traverseTree dirPath, @uploadFile.bind(@), =>
return not @isIgnore(dirPath)
, (->)

initMonitor: ()->
_this = @
@@ -243,7 +244,9 @@ class RemoteSync

fs.traverseTree dirPath, (path)=>
@uploadFile(path) if isChangedPath(path)
, (path)=> return not @isIgnore(path)
, (path) =>
return not @isIgnore(path)
, (->)

createTransport: (host)->
if host.transport is 'scp' or host.transport is 'sftp'
@@ -314,6 +317,6 @@ module.exports =
emitter.on "configured", callback

configPath = path.join projectPath, atom.config.get('remote-sync.configFileName')
host = new Host(configPath, emitter)
host = new Host(configPath, getLogger(), emitter)
view = new HostView(host)
view.attach()
7 changes: 5 additions & 2 deletions lib/model/host.coffee
Original file line number Diff line number Diff line change
@@ -3,15 +3,18 @@ EventEmitter = require("events").EventEmitter

module.exports =
class Host
constructor: (@configPath, @emitter) ->
constructor: (@configPath, @logger, @emitter) ->
return if !fs.existsSync @configPath
try
data = fs.readFileSync @configPath, "utf8"
settings = JSON.parse(data)
for k, v of settings
this[k] = v
catch err
console.log "load #{@configPath}, #{err}"
@logger.error "#{err}, in file: #{@configPath}"
atom.notifications.addError "RemoteSync Error",
{dismissable: true, detail: "#{err}", description: "#{@configPath}" }
throw error

@port?= ""
@port = @port.toString()
9 changes: 5 additions & 4 deletions menus/context.cson
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
'context-menu':
'atom-text-editor, .tree-view.full-menu .file':[
'.entries.list-tree .file.entry.list-item':[
label: 'Remote Sync',
submenu:[
{label: 'Upload File', command: 'remote-sync:upload-file'}
{label: 'Download File', command: 'remote-sync:download-file'}
{label: 'Diff File', command: 'remote-sync:diff-file'}
{label: 'Delete File', command: 'remote-sync:delete-file'}
{label: 'Monitor File (Upload on External Save)', command: 'remote-sync:monitor-file'}
{label: 'Configure', command: 'remote-sync:configure'}
]
]

'.tree-view.full-menu .header.list-item':[
'.entries.list-tree .header.list-item, .header.list-item.project-root-header':[
label: 'Remote Sync',
submenu:[
{label: 'Configure', command: 'remote-sync:configure'}
{label: 'Upload Folder', command: 'remote-sync:upload-folder'}
{label: 'Upload Folder Change', command: 'remote-sync:upload-git-change'}
{label: 'Download Folder', command: 'remote-sync:download-folder'}
{label: 'Diff Folder', command: 'remote-sync:diff-folder'}
{label: 'Delete Folder', command: 'remote-sync:delete-folder'}
{label: 'Configure', command: 'remote-sync:configure'}
]
]
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remote-sync",
"version": "4.1.5",
"version": "4.1.8",
"description": "Upload your files to remote host after every change. Both SCP/SFTP and FTP are supported.",
"license": "MIT",
"repository": "https://github.com/yongkangchen/remote-sync",