Scripting and setting up "Sessions"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DDulac
    New User
    • May 2017
    • 1

    Scripting and setting up "Sessions"

    Hi,

    First, thank you for all that you do. Technology can be intimidating, collaboration leads the way and I appreciate any help. I think its something I am doing that I haven't been able to understand from the documentation.

    The issue: Tattle tale on Dev changes to HTML files in comparison to Prod files. Caveat, the amount of change makes the files *almost* unique

    Where am I struggling: Configuring a session to save. I believe I need to configure and save a "Folder Compare" as a "Session". Then load the session from the script, then load the directories from the script. Expand all the directories from script, then select all differences from the files.

    I "think" the "session" configuration, loaded from script, loads the "Folder Compare Session" to then process all the HTML files in the directories.

    # Log what I am doing
    log verbose append:"Path\Logs\BCLog.txt"

    # Where are these rules coming from, saved "Folder Compare Session"? I want to use regEx to find content between specific html elements like <title>, one at a time. Meaning I would create another session and script to find "<meta>" tag differences in the "<head>" element, how do I configure the rules that will be used in the script?
    criteria rules-based

    # Just want html files evaluated
    filter "*.htm;*.html;"

    # Load the session, (I think this is where I messed up the saved Session for the "rules")
    load "FolderCompareSession"

    # Load the paths to the prod and dev files to compare
    load "Prod Path" "Dev Path"

    # Expand all folders
    expand all

    # Select all files for comparison
    select all.diff

    # Report on the differences
    text-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:"Path\Reports\TextReport.txt"

    Basically want a report that shows the file and a side by side of issues found. Currently I am looking at the tags that are singlular in use with a matching closing tag such as <head>, <nav>, <body>, <footer> but will have to evaluate all changes in content.

    Any input is greatly appreciated.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    Previous to loading the session you are setting the filter and criteria. However, once you load a session, this would replace these settings with the Session's Settings. You can either:
    a) configure and save the session in the graphical interface with the correct filtering, criteria, and even folders.
    b) move these lines to below the session load:

    log verbose append:"Path\Logs\BCLog.txt"
    load "FolderCompareSession"
    filter "*.htm;*.html;"
    criteria rules-based
    load "Prod Path" "Dev Path"
    expand all
    select all.diff
    text-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:"Path\Reports\TextReport.txt"

    How does this work for you?

    Since you have set criteria, then overwrote it with (probably) timestamp and size criteria from the loaded session, the select command would not find "diff" files (since Newer or Older status overrides Diff status).
    Aaron P Scooter Software

    Comment

    Working...