]> git.corax.cc Git - foundry/commitdiff
include/context: Use cp to add files and logs to a context
authorMatthias Kruk <m@m10k.eu>
Wed, 1 Dec 2021 08:17:15 +0000 (17:17 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 1 Dec 2021 08:17:15 +0000 (17:17 +0900)
Files and logs are moved when they are added to a context. However,
this will fail if there are multiple processes trying to move
artifacts from one context to another.
This commit modifies the context module to copy files and logs
instead of moving them.

include/context.sh

index 47caae83c26d432541bd5e998a4836be4bfdd79d..0a5747b69832d8d760340e51d60939bda9e45c75 100644 (file)
@@ -82,7 +82,7 @@ foundry_context_add_file() {
                return 1
        fi
 
-       if ! mv "$file" "$file_path/."; then
+       if ! cp "$file" "$file_path/."; then
                return 1
        fi
 
@@ -128,7 +128,7 @@ foundry_context_add_log() {
                return 1
        fi
 
-       if ! mv "$log" "$logdir/."; then
+       if ! cp "$log" "$logdir/."; then
                return 1
        fi