# Workflow with temporary files
# Tests handling of temp() outputs

rule all:
    input:
        "output/final.txt"

rule create_temp:
    output:
        temp("output/temp_intermediate.txt")
    shell:
        """
        echo "Temporary data" > {output}
        """

rule use_temp:
    input:
        "output/temp_intermediate.txt"
    output:
        "output/final.txt"
    shell:
        """
        cat {input} > {output}
        echo "Final output from temp" >> {output}
        """
