Build branch craftbox/v0.3 with version v0.3.2 to craftbox on branch v0.3 (7d520dc)

Build pipeline: viash-hub.craftbox.v0.3.2-tpktm

Source commit: 7d520dc76c

Source message: Bump version to v0.3.2
This commit is contained in:
CI
2026-03-03 15:18:58 +00:00
parent 6c59599998
commit 4ccb4240e0
39 changed files with 743 additions and 581 deletions

View File

@@ -1,39 +1,52 @@
name: move_files_to_directory
summary: Publish one or multiple files to the same directory
description: This component copies one or multiple files to the same destination directory, creating the output directory if it doesn't exist.
summary: Publish one or multiple files or directories to the same output directory.
description: |
This component copies one or multiple files or directories
to the same destination directory, creating the output directory if it doesn't
exist.
authors:
- __merge__: /src/_authors/dorien_roosen.yaml
roles: [ maintainer ]
arguments:
- name: "--input"
type: file
direction: input
required: true
multiple: true
description: Paths of the files that will be copied into the output directory.
- name: "--output"
type: file
direction: output
required: true
description: Path to output directory
- name: "--keep_symbolic_links"
alternatives: [-d]
type: boolean_true
description: Preserve symbolic links.
argument_groups:
- name: Inputs
arguments:
- name: "--input"
type: file
direction: input
required: true
multiple: true
description: Paths of the files or directories that will be copied into the output directory.
- name: Outputs
arguments:
- name: "--output"
type: file
direction: output
required: true
description: Path to output directory.
- name: Options
arguments:
- name: "--keep_symbolic_links"
type: boolean_true
description: When set, symbolic links are preserved as symbolic links in the output directory. By default, symbolic links are dereferenced and the target file is copied.
resources:
- type: bash_script
path: script.sh
test_resources:
- type: bash_script
path: test.sh
engines:
- type: docker
image: debian:latest
setup:
- type: docker
image: debian:latest
setup:
- type: apt
packages: [procps]
packages:
- procps
- type: native
runners:
- type: executable
- type: nextflow
- type: executable
- type: nextflow

View File

@@ -3,30 +3,37 @@
set -eo pipefail
## VIASH START
par_input="input.txt;input_2.txt"
par_input="input.txt;input_dir.zarr"
par_output="output"
par_keep_symbolic_links="false"
## VIASH END
if [[ ! -d "$par_output" ]]; then
mkdir -p "$par_output"
fi
extra_params=( )
if [ "$par_keep_symbolic_links" == "true" ]; then
extra_params+=( "-d" )
# Set copy flags based on options
if [[ "$par_keep_symbolic_links" == "true" ]]; then
# -a implies -dR --preserve=all
# with -d: same as --no-dereference (and --preserve=links)
# and --no-dereference: never follow symbolic links in SOURCE
# and -R, -r, --recursive: copy directories recursively
# --keep-directory-symlink: if the destination already exists and is a
# symbolic link to a directory, follow the symlink and copy into the directory
# it points to, instead of removing the symlink and creating a real directory in its place.
cp_flags="-a --keep-directory-symlink"
else
# -L: always follow symbolic links in SOURCE
cp_flags="-Lr --preserve=all --no-preserve=link --keep-directory-symlink"
fi
# Process multiple input files
IFS=";" read -ra input_files <<< "$par_input"
for file in "${input_files[@]}"; do
# Check if the file exists before copying
if [[ -f "$file" ]]; then
cp ${extra_params[@]} "$file" "$par_output/"
echo "Copied $file to $par_output/"
# Process multiple input paths (files or directories)
IFS=";" read -ra input_paths <<< "$par_input"
for path in "${input_paths[@]}"; do
if [[ -e "$path" ]] || [[ -L "$path" ]]; then
cp $cp_flags "$path" "$par_output/"
echo "Copied $path to $par_output/"
else
echo "Warning: Input file $file does not exist, skipping"
echo "Warning: Input path $path does not exist, skipping"
fi
done

View File

@@ -11,7 +11,7 @@ trap clean_up EXIT
touch "$TMPDIR/test_file.txt"
touch "$TMPDIR/another_file.txt"
./move_files_to_directory \
$meta_executable \
--input "$TMPDIR/test_file.txt" \
--input "$TMPDIR/another_file.txt" \
--output "$TMPDIR/test_output"
@@ -19,9 +19,23 @@ touch "$TMPDIR/another_file.txt"
[[ ! -d "$TMPDIR/test_output" ]] && echo "It seems no output directory is generated" && exit 1
[[ ! -f "$TMPDIR/test_output/test_file.txt" ]] && [[ ! -f test_output/another_file.txt ]] && echo "Output files were not copied to the output directory" && exit 1
# Test copying a directory
mkdir -p "$TMPDIR/test_dir"
touch "$TMPDIR/test_dir/file_in_dir.txt"
touch "$TMPDIR/test_dir/another_file_in_dir.txt"
$meta_executable \
--input "$TMPDIR/test_dir" \
--output "$TMPDIR/test_output_dir"
[[ ! -d "$TMPDIR/test_output_dir" ]] && echo "It seems no output directory (test_output_dir) is generated" && exit 1
[[ ! -d "$TMPDIR/test_output_dir/test_dir" ]] && echo "Input directory was not copied to the output directory" && exit 1
[[ ! -f "$TMPDIR/test_output_dir/test_dir/file_in_dir.txt" ]] && echo "Files inside the copied directory are missing" && exit 1
[[ ! -f "$TMPDIR/test_output_dir/test_dir/another_file_in_dir.txt" ]] && echo "Files inside the copied directory are missing" && exit 1
ln -s "$TMPDIR/test_file.txt" "$TMPDIR/symlink.txt"
./move_files_to_directory \
$meta_executable \
--input "$TMPDIR/symlink.txt" \
--output "$TMPDIR/test_output_symlink" \
--keep_symbolic_links