diff options
| author | Adrian Kummerlaender | 2014-10-18 16:42:30 +0200 | 
|---|---|---|
| committer | Adrian Kummerlaender | 2014-10-18 16:42:30 +0200 | 
| commit | a5b9f0faee9efdb950aa0558bb68cb320a9e72a4 (patch) | |
| tree | 0c9f8762f4ad46a236fcd7d0de2a80ebb31ac204 /src/steps/process.xsl | |
| parent | 6384ffbd42f34b3639d36623e27889a2781408c1 (diff) | |
| download | StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar.gz StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar.bz2 StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar.lz StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar.xz StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.tar.zst StaticXSLT-a5b9f0faee9efdb950aa0558bb68cb320a9e72a4.zip | |
Introduced new "directory" task type
* tasks of this type expect a path node providing the directory tree to be created
** the path is passed to `mkdir --parents $path` which does the actual work
* this addition was introduced to fix failing `create_link` calls in cases where the link is created before the actual directory is created as a side-effect of `InputXSLT:generate`
** this side-effect causes `InputXSLT:generate` to be impure and should be elimniated in InputXSLT if possible
*** the current hindrance preventing me from doing just that are the `xpath` target declarations which depend on this behaviour
Diffstat (limited to 'src/steps/process.xsl')
| -rw-r--r-- | src/steps/process.xsl | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/src/steps/process.xsl b/src/steps/process.xsl index 29599f4..67c7f24 100644 --- a/src/steps/process.xsl +++ b/src/steps/process.xsl @@ -28,6 +28,14 @@  	)/self::command/@result"/>  </xsl:template> +<xsl:template name="create_directory"> +	<xsl:param name="path"/> + +	<xsl:value-of select="InputXSLT:external-command( +		concat('mkdir --parents ./', $path) +	)/self::command/@result"/> +</xsl:template> +  <xsl:template name="clean">  	<xsl:param name="path"/> @@ -268,4 +276,15 @@  	</xsl:copy>  </xsl:template> +<xsl:template match="task[@type = 'directory']"> +	<xsl:copy> +		<xsl:attribute name="result"> +			<xsl:call-template name="create_directory"> +				<xsl:with-param name="path" select="path"/> +			</xsl:call-template> +		</xsl:attribute> +		<xsl:copy-of select="@* | node()"/> +	</xsl:copy> +</xsl:template> +  </xsl:stylesheet> | 
