Skip to content

Commit

Permalink
Merge pull request #37 from Gawdl3y/master
Browse files Browse the repository at this point in the history
Multiple minor improvements
  • Loading branch information
yongkangchen committed Sep 2, 2014
2 parents e4d47bc + f60e469 commit 60b013a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/Logger.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Logger
else
msg = @showInPanel message, "text-info"
()=>
endMsg = "Complete (#{Date.now() - startTime}ms)"
endMsg = " Complete (#{Date.now() - startTime}ms)"
msg.append endMsg
@panel.setSummary
summary: "#{message} #{endMsg}"
Expand Down
15 changes: 11 additions & 4 deletions lib/RemoteSync.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports =
if exists
load()
else
statusView.update "question", "Couldn't find config"
statusView.update "question", "Couldn't find config."

atom.workspaceView.command "remote-sync:download-all", ->
return if checkSetting()
Expand Down Expand Up @@ -109,7 +109,7 @@ download = (localPath, targetPath, callback)->

minimatch = null
load = ->
fs.readFile configPath,"utf8", (err, data)->
fs.readFile configPath,"utf8", (err, data) ->
return logger.error err if err

try
Expand All @@ -119,11 +119,18 @@ load = ->
logger.error "load #{configPath}, #{err}"
return

if settings.transport is "scp" or settings.transport is "sftp"
transportText = "SFTP"
else if settings.transport is "ftp"
transportText = "FTP"
else
transportText = null

if settings.uploadOnSave != false
statusView.update "eye-watch"
statusView.update "eye-watch", null, transportText
init() if not editorSubscription
else
statusView.update "eye-unwatch", "uploadOnSave disabled."
statusView.update "eye-unwatch", "uploadOnSave disabled.", transportText
unsubscript if editorSubscription

if settings.ignore and not Array.isArray settings.ignore
Expand Down
10 changes: 5 additions & 5 deletions lib/StatusView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports =
class StatusView extends View
@content: ->
@a href: '#', ' SFTP'
@a ' Sync'

initialize: ->
@on 'click', ->
Expand All @@ -18,7 +18,7 @@ class StatusView extends View
else
@subscribe(atom.packages.once('activated', @attach))

update: (iconName, tips) =>
this.element.className = "inline-block icon icon-#{iconName}"
tips = "" if not tips
@setTooltip(tips+" Click to reload config.")
update: (iconName, tips, text) =>
@element.className = "inline-block icon icon-#{iconName}" if iconName
@setTooltip(if tips then tips + " Click to reload config." else "Click to reload config.")
@text(if text then " Sync: " + text else " Sync")
2 changes: 2 additions & 0 deletions lib/commands/DownloadAllCommand.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module.exports =
minimatch = require "minimatch" if not minimatch
async = require "async" if not async

logger.log "Downloading all files: #{path}"

transport.fetchFileTree path, (err, files) ->
return logger.error err if err

Expand Down
4 changes: 2 additions & 2 deletions lib/transports/FtpTransport.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ScpTransport
@_getConnection (err, c) =>
return errorHandler err if err

end = @logger.log "Upload: #{localFilePath} to #{targetFilePath} ... "
end = @logger.log "Upload: #{localFilePath} to #{targetFilePath} ..."

c.mkdir path.dirname(targetFilePath), true, (err) =>
return errorHandler err if err
Expand All @@ -50,7 +50,7 @@ class ScpTransport
@_getConnection (err, c) =>
return errorHandler err if err

end = @logger.log "Download: #{targetFilePath} to #{localFilePath}"
end = @logger.log "Download: #{targetFilePath} to #{localFilePath} ..."

mkdirp = require "mkdirp" if not mkdirp
mkdirp path.dirname(localFilePath), (err) =>
Expand Down
4 changes: 2 additions & 2 deletions lib/transports/ScpTransport.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ScpTransport
@_getConnection (err, c) =>
return errorHandler err if err

end = @logger.log "Upload: #{localFilePath} to #{targetFilePath} ... "
end = @logger.log "Upload: #{localFilePath} to #{targetFilePath} ..."

c.sftp (err, sftp) =>
return errorHandler err if err
Expand Down Expand Up @@ -53,7 +53,7 @@ class ScpTransport
@_getConnection (err, c) =>
return errorHandler err if err

end = @logger.log "Download: #{targetFilePath} to #{localFilePath} ... "
end = @logger.log "Download: #{targetFilePath} to #{localFilePath} ..."

c.sftp (err, sftp) =>
return errorHandler err if err
Expand Down

0 comments on commit 60b013a

Please sign in to comment.