升华设置+软件包与Dropbox同步

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了升华设置+软件包与Dropbox同步相关的知识,希望对你有一定的参考价值。

  1. #!/bin/sh
  2. #
  3. # Set-up Sublime settings + packages sync over Dropbox
  4. #
  5. # Will sync settings + Installed plug-ins
  6. #
  7. # Tested on OSX - should support Linux too as long as
  8. # you set-up correct SOURCE folder
  9. #
  10. # Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com
  11. # Licensed under WTFPL
  12. #
  13.  
  14. # Note: If there is an existing installation in Dropbox,
  15. # it will replace settings on a local computer
  16.  
  17. # No Warranty! Use on your own risk. Take backup of Library/Application Support/Sublime Text 2 folder first.
  18.  
  19. DROPBOX="$HOME/Dropbox"
  20.  
  21. # Where do we put Sublime settings in our Dropbox
  22. SYNC_FOLDER="$DROPBOX/Sublime"
  23.  
  24. # Where Sublime settings have been installed
  25. if [ `uname` = "Darwin" ];then
  26. SOURCE="$HOME/Library/Application Support/Sublime Text 2"
  27. elif [ `uname` = "Linux" ];then
  28. SOURCE="$HOME/.config/sublime-text-2"
  29. else
  30. echo "Unknown operating system"
  31. exit 1
  32. fi
  33.  
  34. # Check that settings really exist on this computer
  35. if [ ! -e "$SOURCE/Packages/" ]; then
  36. echo "Could not find $SOURCE/Settings/"
  37. exit 1
  38. fi
  39.  
  40. # Detect that we don't try to install twice and screw up
  41. if [ -L "$SOURCE/Packages" ] ; then
  42. echo "Dropbox settings already symlinked"
  43. exit 1
  44. fi
  45.  
  46. # XXX: Disabled Settings/ folder syncing as looks like
  47. # Sublime keeps only license and .sublime_session files -
  48. # the latter
  49. # which are autosaved and would cause unnecessary conflicts
  50. # and traffic
  51.  
  52. # Dropbox has not been set-up on any computer before?
  53. if [ ! -e "$SYNC_FOLDER" ] ; then
  54. echo "Setting up Dropbox sync folder"
  55. mkdir "$SYNC_FOLDER"
  56. cp -r "$SOURCE/Installed Packages/" "$SYNC_FOLDER"
  57. cp -r "$SOURCE/Packages/" "$SYNC_FOLDER"
  58. # cp -r "$SOURCE/Settings/" "$SYNC_FOLDER"
  59. fi
  60.  
  61. # Now when settings are in Dropbox delete existing files
  62. rm -rf "$SOURCE/Installed Packages"
  63. rm -rf "$SOURCE/Packages"
  64. #rm -rf "$SOURCE/Settings"
  65.  
  66. # Symlink settings folders from Drobox
  67. ln -s "$SYNC_FOLDER/Installed Packages" "$SOURCE"
  68. ln -s "$SYNC_FOLDER/Packages" "$SOURCE"
  69. #ln -s "$SYNC_FOLDER/Settings" "$SOURCE"

以上是关于升华设置+软件包与Dropbox同步的主要内容,如果未能解决你的问题,请参考以下文章

使用 MAMP Pro 3 将 mysql 数据库与 Dropbox 同步

有没有免费的密码管理软件求大神分享!

sh 快速克隆Sublime(3)设置为Dropbox上的ZIP(同步)

将点文件与 Dropbox 同步 [关闭]

评估将核心数据与 Dropbox 同步的策略

手机无法登陆dropbox