What is the format of ($Files)?

tclimistclimis Posts: 5 Bronze 1
I have two applications that use a common framework. The database is split up accordingly, via schemas. so I have a core schema for shared db objects, an app1 schema for objects unique to app1, and an app2 schema for objects unique to app2. Right now, I have two databases, with many shared objects that I have to try and keep in sync. It's a bit of a nightmare.

What I'd like to do is store the SQL definition scripts in separate directories, so I have a single copy of each database object, even though the core objects appear in two databases. My build process would merge these directories into a single build directory which is the one I link to Source Control.

Then when I change an item, Source Control would write the definition back to the build directory. What I'm trying to do is write a script that will run on Add that reads the schema from the file name, copies the file into the correct source directory, and adds it there instead of in the build directory.

As such, just passing ($Files) isn't good enough for me - I need to know what's actually contained in that variable. Is it the absolute path, the relative path (relative to what?), or just the file name without directory information (seems unlikely)?

Also, is there some way I can get debugging data out? I tried adding "> file.txt" to the command (remembering to escape it for XML), but no file was created.


  • Hello,

    We've opened a ticket for this question as it's a little more complicated than forum communications allow. I'll update this forum thread with what we find out through the ticket. I'll be responding to you there shortly after submitting this message, thanks.
    Allen LeVan
    Red Gate Software
    US Product Support
  • tclimistclimis Posts: 5 Bronze 1
    I figured out the answers to my questions after the developers told me what I wanted couldn't be done.

    The commands in the xml file (git.xml, mercurial.xml, etc.) need to run via cmd (not, say powershell). They are called with the repository as the active working directory.

    $ScriptsFolder is the absolute path to the repository (C:myProject)
    $Files is the list of files relative to $ScriptsFolder (Tablesdbo.table.sql, etc.)
    $MessageFile is the absolute path to the commit message temp file

    I don't know if anyone else will find a use for this knowledge, but it took me long enough to sort out, that I figured I should post it.
Sign In or Register to comment.