fix(droplet): Strip CR/LF from file extension detection
Windows uploads may include carriage returns in filenames, causing .zip to be detected as .ziw. Strip \r\n from extension string. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a905b885fc
commit
b76131ed1d
@ -75,7 +75,8 @@ cmd_publish() {
|
|||||||
log_info "Publishing: $file as $vhost"
|
log_info "Publishing: $file as $vhost"
|
||||||
|
|
||||||
# Detect file type by extension (file command not available on OpenWrt)
|
# Detect file type by extension (file command not available on OpenWrt)
|
||||||
local file_ext=$(echo "$file" | sed 's/.*\.//' | tr '[:upper:]' '[:lower:]')
|
# Strip any CR/LF that may come from Windows uploads or JSON parsing
|
||||||
|
local file_ext=$(echo "$file" | sed 's/.*\.//' | tr '[:upper:]' '[:lower:]' | tr -d '\r\n')
|
||||||
|
|
||||||
if [ "$file_ext" = "zip" ]; then
|
if [ "$file_ext" = "zip" ]; then
|
||||||
log_info "Extracting ZIP..."
|
log_info "Extracting ZIP..."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user