Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Set variable from file



  • I have several places in my plans where I set a variable value from a file. In OtterScript (since 5.0), it is shown as a legacy action. What recommendation do you have for bringing it up-to-date? Is there a different action I should use? Or do I need to write a custom function? I'm also curious as to why this isn't supported any more...

    Sample:

    Execute-LegacyAction

            (
                Config: <Inedo.BuildMaster.Extensibility.Actions.Variables.SetVariableFromFileAction Assembly="BuildMasterExtensions"><Properties VariableName="RunScripts" FileName="ScriptsToRun.txt" MaxLength="14" OverriddenSourceDirectory="C:\BuildMasterAgent\buildscripts" /></Inedo.BuildMaster.Extensibility.Actions.Variables.SetVariableFromFileAction>
            );
    

    Product: BuildMaster
    Version: 5.2.3



  • It's supported using the Legacy Action, which isn't ideal obviously.

    This will be replaced with a function in v5/OtterScript:

    # reads at most 250 characters from the file
    set $hdarfs = $FileContents(c:\hdarfs\info.txt, 250);
    Log-Information $hdarfs;
    

    However, this function is only available in 5.3 (which is shipping this week).



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation