Source Control Your Custom Scripts & mklink

Previous topic - Next topic

jlpoole

This was written about a Windows 7 platform as that is what I have..  This should work for Windows Server 2008, as well.

Having your customized scripts in a safe place, such as a Subversion source control system, is well worth the upfront effort because you do not want to accidentally loose them.  If you like to tweak scripts and sometime revert to previous versions, then source control is, indeed, your friend.  Also, if you happen to work in both Linux and Windows, having your files in one source control tree that is shared between both environments stabilizes your development work.  For ease in Windows, I recommend creating a soft linked directory under your "scripts" directory that points to another location on your computer.  For example, in Scribus 1.5 for Windows you have a default location for scripts shipped with Scribus:

    C:\Program Files\Scribus 1.5.0\share\scripts

I recommend creating a subdirectory thereunder.  But, it would be good to have the files in that subdirectory subject to source control.  You have two options: 1) creating a source controlled directory directly under "scripts", or 2) creating a soft link under "scripts" that points to your staged work area in another directory where you do most of your work for files under source control.  This posting will address the second alternative: soft link.

Microsoft has a tool, mklink, which allows you to create links in Windows.  Links in Linux are an accepted norm, but in Windows they may be a new concept to users. Open a DOS console and type:

help mklink

If mklink is installed on your system, there will be displayed some concise help documentation.  If you do not have mklink installed, I think you may be able to download it from Microsoft, but it may only be available for later releases of Windows.

Here's an example of commands to execute in a DOS console:

    cd  C:\Program Files\Scribus 1.5.0\share\scripts
    mklink /D ep D:\Temp\ep\python


Here's an actual session:

    C:\Program Files\Scribus 1.5.0\share\scripts>mklink /D ep D:\Temp\ep\python
    symbolic link created for ep <<===>> D:\Temp\ep\python
   
    C:\Program Files\Scribus 1.5.0\share\scripts>


So, I have under D:\Temp\ep my source control tree for a project that involves Scribus.  I use the "scripts" directory to hold all my python scripts for Scribus.  And when I'm in Linux, I can create a subdirectory "ep" under scripts, e.g. /usr/local/src/scribLinus/share/scripts.  By going to this effort, I have both my Linux and Windows Scribus sessions access basically the same scripts kept in sync through Subversion.

See also:
    Tortoise Subversion Client at http://tortoisesvn.net/
    Subversion for Windows https://sourceforge.net/projects/win32svn/
John L. Poole

work: Principal Software Engineer, Oracle Corporation
play: Editions Poole - publisher of classical ensemble piano music (using InDesign & scripts thereunder)