pack-mmip, an automatic MMIP packer using Node.js
Posted: Mon Oct 12, 2020 12:14 pm
Hey there! I wrote a tool that makes it quick and easy to pack and install MM5 extensions! I named it pack-mmip, and it's available on github and npm.
It requires Node.js. Install it with one of two methods:
Pack-mmip automatically creates an archive with an .mmip extension, and pack-zip automatically creates an archive with a .zip extension. MMIPs are just zip archives with a different filename, so the same tool can be used for both purposes.
Usage:
You can set your own default options with the following commands:
Examples:
So for example, if you have PowerShell/cmd open in your project's parent folder, and the project is named MyExtension, this will pack MyExtension.mmip and immediately install it.
I've been working on this tool for a few months, and it's reaching the point where it's becoming a genuinely useful tool.
I really hope this is helpful! Let me know if any of you use it, or if you have suggestions for improvements!
It requires Node.js. Install it with one of two methods:
- NPM: npm install --global pack-mmip
- Download the latest release from the github page, extract it into the folder of your choice, and add the folder to your system PATH.
Pack-mmip automatically creates an archive with an .mmip extension, and pack-zip automatically creates an archive with a .zip extension. MMIPs are just zip archives with a different filename, so the same tool can be used for both purposes.
Usage:
Code: Select all
USAGE:
pack-mmip <path to project> <[optional] path to packed extension OR just its name> <options>
OPTIONS:
-a --AppendVersion Read the project's version from its info.json and append it to the
filename. For example: MyAddon-1.2.3.mmip
-b --PutFileIntoBin Put resulting file into a subfolder named "bin"
-d --Debug Debug logs. Please use this if you encounter a bug, and paste the
logs into a new GitHub issue.
-h --help Print this help text and exit
-i --IgnoreDefaults Ignore configuration rules
-o --OpenAfterComplete Open file (Install to MediaMonkey) after complete
-s --ShowAfterComplete Show in folder after complete
-v --version Print version and exit
-y --Yes Automatically answer "yes" to prompts
-p --PreambleFile <name> File containing a preamble to be added to the top of text files.
--preamble-<filetype> <pattern> Pattern for the preamble to be inserted into files of the specified
patterns for comments. Use %s for where the preamble text should go.
TO IGNORE CERTAIN FILES:
Add a file named .mmipignore or .archiveignore in your project root.
It uses glob syntax similar to .gitignore
(see https://www.npmjs.com/package/glob)
pack-mmip config Different configuration files are saved for pack-mmip and pack-zip.
If path to packed extension is not specified, it will default to the name of the folder.
--create-symlink <path> Tool that creates a symbolic link from your install's scripts folder to
your project folder, making it easier for development. Just restart
MediaMonkey for your changes to take effect, instead of having to
re-pack and re-install the addon.
--init Tool that automatically creates a new info.json file in the current
folder, after prompting for title, ID, version, etc. Similar to `npm init`.
Code: Select all
pack-mmip config
pack-zip config
Code: Select all
# Packs C:/projects/MyPackage into C:/projects/MyPackage.mmip
pack-mmip C:/projects/MyPackage C:/projects/MyPackage.mmip
# Does the same as above, but with relative paths instead of absolute paths
# If you do not add a .mmip file extension, it will do it for you.
cd C:/projects/MyPackage
pack-mmip ./ ../MyPackage
# If you do not specify a file name, it will automatically give it the name of the original folder.
cd C:/projects
pack-mmip MyPackage MyCustomPackageName
# result: C:/projects/MyCustomPackageName.mmip
pack-mmip MyPackage
# result: C:/projects/MyPackage.mmip
pack-zip MyPackage
# result: C:/projects/MyPackage.zip
# The -s argument will open a file explorer window containing the newly packed file.
pack-mmip MyPackage -s
# The -o argument will attempt to run the file, causing MediaMonkey to install it.
pack-mmip MyPackage -o
# The -b argument will place your packaged file into a subfoler named "bin".
pack-mmip MyPackage -b
# result: C:/projects/bin/MyPackage.mmip
Code: Select all
pack-mmip MyExtension MyExtension.mmip -o
I really hope this is helpful! Let me know if any of you use it, or if you have suggestions for improvements!