@weichienhung/watchme

0.9.2 • Public • Published

Watch file changes and upload to remote servers

Q: Why should i need this? A: Company ssh policy is a little big complex and i found many sftp plugin didn't work well. But the mac laptop rsync,sftp works ok. So i create a simple project to monitor changes and do upload to remote servers

Dependencies

  1. Install facebook's watchman on your laptop
  2. Install nodejs (version > 12.18.0)

How to use?

  1. install the package globally
> npm install @weichienhung/watchme -g
  1. init a config file

e.g: /User/samuelhung/myproject/ is the folder you want to monitor and auto upload change files. Run below command to get a config .watchme.json

> watchme -i

An example of .watchme.json

{
  "host": "remote server hostname",
  "user": "samuelhung",
  "type": "rsync",
  "remote_path": "/home/samuelhung/myproject",
  "debug": true,
  "ignore_regexes": [
    "watchme\\.json",
    "/venv/",
    "\\.svn/",
    "\\.hg/",
    "\\.git/",
    "\\.bzr",
    "_darcs",
    "CVS",
    "\\.DS_Store",
    "Thumbs\\.db",
    "desktop\\.ini",
    "node_modules/",
    "\\.vscode"
  ]
}

You can set a global config file in home dir. e.g: ~/.watchme.json Put common settings. like ignore_regexes

{
  "ignore_regexes": [
    "watchme\\.json",
    "/venv/",
    "\\.svn/",
    "\\.hg/",
    "\\.git/",
    "\\.bzr",
    "_darcs",
    "CVS",
    "\\.DS_Store",
    "Thumbs\\.db",
    "desktop\\.ini",
    "node_modules/",
    "\\.vscode"
  ]
}

The final config are merged from global and local.

  1. execute watchme

It will start monitor the folder and do upload when file changes.

> cd /User/samuelhung/myproject/
> watchme

Print watchme usage.

> watchme -h

Support watch multiple folders

Use -p profile1,profile2 to specify multiple configs

> watchme -p profile1,profile2

Readme

Keywords

none

Package Sidebar

Install

npm i @weichienhung/watchme

Weekly Downloads

1

Version

0.9.2

License

ISC

Unpacked Size

21.1 kB

Total Files

12

Last publish

Collaborators

  • weichienhung