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

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

Moderators: jiri, drakinite, Addon Administrators

drakinite
Posts: 301
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 and pack-zip commands from any folder.

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

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
        -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.
        -i      --IgnoreDefaults        Ignore configuration rules
        
If path to packed extension is not specified, it will default to the name of the folder.
You can set your own default options with the following commands:

Code: Select all

pack-mmip config
pack-zip config
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

# 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
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
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!
Last edited by drakinite on Sat Nov 28, 2020 10:56 pm, edited 2 times in total.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

pack-mmip Release v0.0.3

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.
Last edited by drakinite on Sat Nov 28, 2020 10:27 pm, edited 1 time in total.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Ludek
Posts: 3689
Joined: Fri Mar 09, 2007 9:00 am

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

Post by Ludek »

Nice!
drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

pack-mmip Release v0.0.4

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:
Last edited by drakinite on Sat Nov 28, 2020 10:27 pm, edited 1 time in total.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

pack-mmip Release v0.0.5

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
Last edited by drakinite on Sat Nov 28, 2020 10:27 pm, edited 1 time in total.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

pack-mmip Release v1.0.0

Post by drakinite »

I'm proud to announce pack-mmip version 1.0.0! This is a major release, which brings some great new usability features and improvements:
  • Configurable default settings
  • Ability to easily archive .zip files as well, with pack-zip
  • Ability to automatically put your packed files into a "bin" subfolder
You can download it here: https://github.com/JL102/pack-mmip/releases/tag/v1.0.0
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Post Reply