     dirname = _path.dirname(localPath)
     return unless localPath? and dirname?
     fs.makeTreeSync(dirname) unless fs.existsSync(dirname)
-    fs.writeFile(localPath, contents)
+    decoded = new Buffer(contents, 'base64').toString('utf8')
+    fs.writeFile(localPath, decoded)
 
   onRescue: ({message}) ->
     console.log "RESCUE: #{message}"

  #-------------

  fetch: (paths) ->
    pathsToFetch = paths.map (path) -> convert.localToRemote(path, @localRoot)
    @send {command: 'fetch', paths: pathsToFetch}

  #--------------------

Sync = require './sync'
FileStat = require './file-stat'

serverURI = 'ws://vm02.students.learn.co:3304/background_sync'
token     = atom.config.get('integrated-learn-environment.oauthToken')

convert =
