A lightweight batch script to package Sublime Text plugins into .sublime-package files.
Simply drag one or more plugin folders onto the .bat file, and it will output the packaged files in the same directory as the script.
- Drag-and-drop support (multiple plugin folders at once)
- Automatically generates
.sublime-package(ZIP format) - Reads
.gitignoreto exclude unnecessary files - Supports saving the
7z.exepath to Windows PATH
- Download or clone this repository
- Place
drag_build_package.batanywhere - Drag plugin folders (e.g.,
MyPlugin/) onto the.batfile - The script will generate: alongside the
.bat
- The script defaults to
7z.exepath: C:\Program Files\PeaZip\res\7z\7z.exe - If not found, it will prompt you to enter a path (either a folder containing
7z.exeor the full executable path) - Once verified, the path will be saved to the registry:
- On subsequent runs, this saved path will be used automatically
The script excludes the following files/directories automatically:
.git.gitignore- Rules from the project’s
.gitignore(ignores comments starting with#)
Given a folder structure:
Packages/
├── MyPlugin/
| ├── Main.py
| ├── MyPlugin.sublime-settings
| └── .git/
└── drag_build_package.bat
Drag MyPlugin/ onto drag_build_package.bat.
The output will look like this:
Packages/
├── MyPlugin/
| ├── Main.py
| ├── MyPlugin.sublime-settings
| └── .git/
├── drag_build_package.bat
└── MyPlugin.sublime-package // generated file
MIT License
You are free to use, modify, and distribute this script.
