File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -61,17 +61,27 @@ runs:
61
61
fi
62
62
63
63
DEBUG="${{ inputs.debug }}"
64
- INPUT_PATHS=${{ inputs.source_path }}
64
+ INPUT_PATHS=" ${{ inputs.source_path }}"
65
65
CUTOFF_OPTION=$([ -n "${{ inputs.upload_cutoff }}" ] && echo "--drive-upload-cutoff=${{ inputs.upload_cutoff }}" || echo "")
66
66
67
67
# Create a temporary file to store all matched file paths
68
68
MATCHED_FILES=$(mktemp)
69
69
70
- for file in $INPUT_PATHS; do
71
- echo "$file" >> "$MATCHED_FILES"
72
- done
70
+ # Process each line of input paths
71
+ while IFS= read -r line; do
72
+ # Skip empty lines
73
+ [[ -z "$line" ]] && continue
74
+
75
+ # Expand the glob pattern and add matching files
76
+ for file in $line; do
77
+ if [[ -e "$file" ]]; then
78
+ echo "$file" >> "$MATCHED_FILES"
79
+ fi
80
+ done
81
+ done <<< "$INPUT_PATHS"
73
82
74
83
if [ "$DEBUG" = true ]; then
84
+ echo "Matched files:"
75
85
cat "$MATCHED_FILES"
76
86
fi
77
87
87
97
echo "Uploading $file to google_drive:${{ inputs.destination_path }}"
88
98
rclone copy $CUTOFF_OPTION "$file" "google_drive:${{ inputs.destination_path }}"
89
99
done < "$MATCHED_FILES"
100
+
101
+ # Clean up
102
+ rm "$MATCHED_FILES"
90
103
You can’t perform that action at this time.
0 commit comments