samuell / scicommander

Run shell commands in a scientifically reproducible and robust way
MIT License
13 stars 1 forks source link

Super cool tool, small issue with deleting and regenerating .au files. Maybe I did something wrong? #12

Open jelber2 opened 2 months ago

jelber2 commented 2 months ago

Hi, This is a super cool tool that I think would be very useful for many use cases. I just starting playing around with the sci shell with scicommander-0.4.0-linux-amd64.tar.gz.

cd /home/jelber43/git
wget 'https://github.com/samuell/scicommander/releases/download/0.4.0/scicommander-0.4.0-linux-amd64.tar.gz'
# first untar
tar xzf scicommander-0.4.0-linux-amd64.tar.gz
# add sci to path
export PATH="/home/jelber43/git:$PATH"
# enter sci shell
sci shell

# do some processing
echo "ACTG" > dna.fa

# Executing command via SciCommander: echo "ACTG" > dna.fa

cat ACTG | tr ACTG TGAC > dna.compl.fa

# Executing command via SciCommander: cat ACTG | tr ACTG TGAC > dna.compl.fa

# exit sci shell with ctrl+c

whoops, I made a mistake, so I will delete the .au file for dna.compl.fa

rm dna.compl.fa.au

ok, now try to fix the dna.compl.fa file command

sci shell
cat dna.fa | tr ACTG TGAC > dna.compl.fa

# Executing command via SciCommander: cat dna.fa | tr ACTG TGAC > dna.compl.fa

# exit sci shell

strange, the dna.compl.fa.au file is missing, and I cannot seem to recreate it. Am I missing something? Am I doing something wrong?

samuell commented 2 months ago

Thanks for trying it out @jelber2 and for the kind feedback!

strange, the dna.compl.fa.au file is missing, and I cannot seem to recreate it. Am I missing something? Am I doing something wrong?

And, yes, I've noticed this as well.

The issue is that when the accompanying output file already exists, the command will not be run, and so the audit file will not be re-created either.

I'm not sure what is the best approach here.

I think in a way it make sense that it is not re-created, as the audit file should only be created when a command is actually executed. Otherwise it would not tell the truth regarding execution timestamp etc.

One option perhaps is that execution would only be skipped if both the output file and its .au file existed, meaning that it would re-create the output file if the .au file is missing. How does that sound to you?

jelber2 commented 2 months ago

One option perhaps is that execution would only be skipped if both the output file and its .au file existed, meaning that it would re-create the output file if the .au file is missing. How does that sound to you?

That sounds fine to me.

jelber2 commented 2 months ago

But does that mean all I have to do is remove the output file and it will then recreate the .au? EDIT, I have confirmed this to be the true...