Version Control And File Naming Advice
When you move on to creating Plugins for yourself or for the Plugin Store it really helps to be able to manage the files and the file levels. These notes are intended to help Plugin authors make use of available tools as well as produce consistent Plugins
The Script Header
When starting a Plugin it's a very good idea to add a Plugin Header which can easily be done from the Edit » Insert Script Header option.
This will insert the following to the top of your file.
--[[ @Title: @Author: @Version: @LastUpdated: @Description: ]]
The title should exactly match the Plugin name, and use only alpha-numeric characters.
The description field can be written over multiple lines, leave a blank line to mark paragraphs.
It's a good idea to start with a version number of 0.1 and then move up to 1.0 when you are ready to release the Plugin to the Store.
Using a mainfunction
Although not required, it can be a good idea to use a mainfunction for any more complex Plugins that use extra functions, as it allows you to keep the main code at the top of the source code.
A simple example would be
function mainfunction() print(hello()) end function hello() return 'hello' end ---------------------------- call mainfunction mainfunction()
In the commercial programming world, version control systems are very important as they allow a fairly easy way of tracking changes over time.
There are many different ones and some need a dedicated server. However, there are several systems for Windows which are suitable for home Plugin writers.
A fairly easy to use Windows control system is msysGit, which once installed allows the easy creation of a repository (where all the changed code lives) inside your Plugins folder and allows files to be managed easily using right click on the files in the folder or using Git Gui. There is a nice guide to getting started with git at NathanJ:An Illustrated Guide to Git on Windows for home use you can ignore the Putty section.
The latest version can be downloaded from msysGit Downloads.