two-way-merge
This merge tool simply merges two directories into each other. When there is a conflict, the merge takes the file with the later modified date.
Any file that ends with .delete
will flag the file as requiring deletion. For instance dirA/path/to/file.delete
will delete dirA/path/to/file
, dirB/path/to/file
, dirA/path/to/file.delete
, and dirB/path/to/file.delete
Installation
npm i -g @briananders/two-way-merge
Usage
twowaymerge merge path/to/directory path/to/another/directory
In a crontab chron job, you have to link absolutely as your PATH is empty.
DO NOT DO THIS: twowaymerge merge "~/Google Drive/configs" "~/configs"
Do this: /Users/briananders/.nvm/versions/node/v17.5.0/bin/node /opt/homebrew/lib/node_modules/@briananders/two-way-merge/index.js merge "/Users/briananders/Google Drive/configs" "/Users/briananders/configs"
Dev Setup
- Clone the repo
- Install dependencies
npm i
- Globally install the module
npm i -g