Introduces the new variable PLASTER_TemplateSource#316
Introduces the new variable PLASTER_TemplateSource#316schittli wants to merge 2 commits intoPowerShellOrg:masterfrom
Conversation
…the template full FileName which is used to create a File Example of use: # Used Template: <%=$PLASTER_TemplateSource%> Will get the full Template name: # Used Template PowerShellOrg#2: C:\…\scaffold\Build.template
src/InvokePlaster.ps1
Outdated
|
|
||
|
|
||
| # Dot source the individual module command scripts. | ||
| . .\NewPlasterManifest.ps1 |
There was a problem hiding this comment.
We don't dot source these here but in the psm1 file.
There was a problem hiding this comment.
I don't understand this one... thanks a lot for cleaning it.
src/InvokePlaster.ps1
Outdated
| . .\WritePlasterParameter.ps1 | ||
| . .\WritePlasterManifestContent.ps1 | ||
|
|
||
| Invoke-Plaster c:\GitWork\Clones\GitHub\�Tom\ModuleBuild\release\ModuleBuild\plaster\ModuleBuild\ c:\Temp\--\-PSModul\ModuleBuildTest2\ |
There was a problem hiding this comment.
I'm not sure what is up with this but it needs to be removed.
There was a problem hiding this comment.
I'm very sorry that I missed this debugging code and checked it in.
Thanks for removing it!
src/InvokePlaster.ps1
Outdated
| # Eval script expression delimiters | ||
| if ($content -and ($content.Count -gt 0)) { | ||
| # Sets the Variable to the currently used template | ||
| Set-Variable -Name PLASTER_TemplateSource -Value $srcPath -Scope Script |
There was a problem hiding this comment.
I think this is reasonable but I'd probably want to name this something like PLASTER_TemplateFileSource.
There was a problem hiding this comment.
In my tests, it worked fine...
PLASTER_TemplateFileSource is more precise than PLASTER_TemplateSource
I was not sure if there are situations, where Files are created just by code (without any template file) and then, PLASTER_TemplateSource could be used for both situations (Generated by code and generated by Template)
- Renamed the new Variable to `PLASTER_TemplateFileSource` - Removed the 'debugging Code' Lines at the very end of the source file. I'm very sorry for this.
|
This was my 1st contribution with bugs and I did not know the workflow... I just have fixed the issues and hope it's done the right way... |
|
Good evening |
| # Eval script expression delimiters | ||
| if ($content -and ($content.Count -gt 0)) { | ||
| # Sets the Variable to the currently used template | ||
| Set-Variable -Name PLASTER_TemplateFileSource -Value $srcPath -Scope Script |
There was a problem hiding this comment.
Unfortunately this doesn't work "as-is" because setting a variable in this runspace doesn't help since the template file is processed in a constrained runspace. The variable needs to be set there. I'll noodle on this some as I really like the idea of providing this info inside a template file.
|
Not needed |
The new variable PLASTER_TemplateSource references the template full FileName which is used to build a File. Example of use:
# Used Template: <%=$PLASTER_TemplateSource%>Will get the full Template name:
# Used Template #2: C:\…\scaffold\Build.template