1.3.3 • Published 6 years ago

sync-my-code v1.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

sync-my-code

一个同步本地和SFTP服务器文件的工具。

主要功能:

  1. 工具启动时,会同步本地工作目录和远程工作目录。
  2. 启动后,会实时监测本地工作目录的修改,并即时更新远程工作目录。

已经在Windows和MacOS上通过测试。

安装

npm install sync-my-code -g

使用说明

$ sync-my-code --help

  Usage: sync-my-code [options]

  一个同步本地和SFTP服务器文件的工具。

  Options:

    -V, --version                     output the version number
    -w, --work-path [value]           需要同步的本地工作路径
    -c, --create-syncrc-path [value]  在指定目录创建一个.syncrc.json
    -h, --help                        output usage information

运行程序目前有两个可选参数-w-c: 1. -w指定需要同步的本地工作路径。要求本地工作路径下有.syncrc.json配置文件。 2. -c指定一个需要生成配置文件的工作目录。程序会在生成.syncrc.json配置文件后自动退出。

配置文件是一个JSON文件:

{
  "config": {
    "remote_host": "localhost",
    "remote_port": 22,
    "remote_username": "root",
    "remote_password": "root",
    "remote_path": "/root",
    "ignore_file":[],
    "ignore_dir":[
      ".idea",
      "node_modules",
      ".git"
    ],
    "ignore_watch": "(.*___jb_tmp___)|(.*___jb_old___)|(\\.idea\/.*)|(\\.git\/.*)|(\\.idea\\.*)|(\\.git\\.*)"
  }
}

配置文件说明:

配置项数据类型说明
remote_hostString远程SFTP服务器的域名或IP
remote_portNumber远程SFTP服务器的端口号
remote_usernameString远程SFTP服务器的用户名
remote_passwordString远程SFTP服务器的密码
remote_pathString远程SFTP服务器的同步工作路径
ignore_fileArray在同步文件中需要过滤的列表
ignore_dirArray在同步文件夹中需要过滤的列表
ignore_watchString在实时监测文件变化中,需要匹配的正则表达式。注1

注1:当文件名能够匹配正则表达式时,这个文件会被忽略,这个配置,主要用来过滤一些临时文件。

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago