pack-mmip, an automatic MMIP packer using Node.js

To discuss development of addons / skins / customization of MediaMonkey.

Moderator: jiri

drakinite
Posts: 248
Joined: Tue May 12, 2020 10:06 am
Contact:

pack-mmip, an automatic MMIP packer using Node.js

Post by drakinite »

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.

It requires node.js. Download the latest release from the github page, extract it into the folder of your choice, and add the folder to your system PATH. Then you can use the pack-mmip command from any folder.

Usage:

Code: Select all

pack-mmip (path to directory) ([optional] path to packed extension OR just its name) (options)
 
OPTIONS: 
        -y      --Yes                   Automatically answer "yes" to prompts
        -o      --OpenAfterComplete     Open file (Install to MediaMonkey) after complete
        -s      --ShowAfterComplete     Show in folder after complete
        -d      --debug Debug logs. Please use this if you encounter a bug, and paste the logs into a new GitHub issue.
If path to packed extension is not specified, it will default to the name of the folder.
Examples:

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

# 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

# This example will automatically create C:/projects/MyPackage.mmip
cd C:/projects
pack-mmip ./MyPackage
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.

Code: Select all

pack-mmip MyExtension MyExtension.mmip -o
So far, I have warnings implemented for "destination file already exists" (overwrite) and "destination file is inside the directory that will be archived" (which can cause issues with the MMIP being inside itself). Also, it probably only works on Windows right now.


I really hope this is helpful! Let me know if any of you use it, or if you have suggestions for improvements!
Last edited by drakinite on Tue Oct 27, 2020 3:15 pm, edited 1 time in total.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 248
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: pack-mmip, an automatic MMIP packer using Node.js

Post by drakinite »

Published version 0.0.3! You can download it here: https://github.com/JL102/pack-mmip/releases/tag/v0.0.3

Now, if you just specify the source folder, it'll automatically give the resultant MMIP the same name as the source folder.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 248
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: pack-mmip, an automatic MMIP packer using Node.js

Post by drakinite »

New release, v0.0.4: Node screws up command-line arguments if you include a backslash before a quotation mark, which occurs in PowerShell when you automatically populate a directory. I did as much as much as I could to rectify those situations when process.argv is broken. https://github.com/JL102/pack-mmip/releases/tag/v0.0.4

Also, thanks Ludek! :slight_smile:
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 248
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: pack-mmip, an automatic MMIP packer using Node.js

Post by drakinite »

New release, v0.0.5: Better recognition & handling of broken command-line arguments, and changed the destination-inside-source warning to have a default answer of no. https://github.com/JL102/pack-mmip/releases/tag/v0.0.5
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Post Reply