Whoopsie is a command-line tool that watches specified files and directories and creates periodic zip backups of specified file types, respecting .gitignore rules. It's perfect for creating quick, automatic backups of your projects.
Basically, it's a way of automating the dumb-dumb backups I already do when working on a git project and I know I'll forget to commit regularly.
Built for MacOS, could probably be ported elsewhere without too much effort.
- Watch specified files and directories for changes
- Create zip backups of specified file types
- Respect
.gitignorerules (searches parent directories for .gitignore) - Customizable backup interval
- Customizable backup save location
- Option to watch only specific files or directories
- Option to add custom ignore patterns
- Easy to install and use globally
To install Whoopsie globally, follow these steps:
-
Clone the repository:
git clone https://github.com/laffan/whoopsie.git cd whoopsie -
Install dependencies and build the package:
npm install npm run build -
Create a global symlink:
npm link
Now, you can use the whoopsie command from anywhere in your system.
The basic syntax for using Whoopsie is:
whoopsie [projectName] [filetypes] [options]
projectName: Name of your project (required)filetypes: Comma-separated list of file extensions to backup (default: .js,.css,.html)
Options:
-s, --seconds <seconds>: Set the interval between backups in seconds (default: 30)--saveTo <path>: Specify a custom save location for backups--only <paths>: Watch only specified files/folders (comma-separated list of paths)--ignore <patterns>: Additional patterns to ignore (comma-separated)
Examples:
-
Basic usage (watches entire current directory):
whoopsie myProject .js,.css,.html --seconds 60 -
With custom save path:
whoopsie myProject .js,.css,.html --seconds 60 --saveTo /custom/save/path -
Watch only specific files/folders:
whoopsie myProject .js,.css,.html --only src,public/images,index.html -
Add custom ignore patterns:
whoopsie myProject .js,.css,.html --ignore node_modules,*.log -
Combining options:
whoopsie myProject .js,.css,.html --seconds 120 --saveTo /custom/save/path --only src,public --ignore temp,*.bak
This will watch the specified files and directories, creating backups of specified file types at the given interval, and save the backups to the specified location or ~/Documents/Whoopsie/[projectName] if not specified.
To make changes to Whoopsie:
- Make your code changes
- Run
npm run buildto rebuild the package - The global
whoopsiecommand will automatically use your updated version
To remove the global symlink:
npm unlink whoopsie
Whoopsie is a free-for all.