Skip to content

Commit 0a8ddb8

Browse files
committed
Removes the need for an intermediate ZIP file that only caused problems.
1 parent 69d7ff8 commit 0a8ddb8

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

docs-post

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ DEST_URL=http://localhost/docs-manager.php
1010
#@TODO: Run the appropriate command to generate docs if output path is not already populated.
1111

1212
SRC_DIR=tmp/coverage/html
13-
TMP_FILE=tmp/upload.zip
1413
PROJECT_NAME=${PROJECT_NAME}-coverage
1514

16-
zip -rq9 "$TMP_FILE" "$SRC_DIR"
17-
curl \
18-
-FauthToken=$TOKEN \
19-
-FprojectName=$PROJECT_NAME \
20-
-Ffile=@"$TMP_FILE;type=application/zip" \
15+
# This ensures no intermediate directories are stored in the ZIP file.
16+
cd "$SRC_DIR"
17+
18+
# Send the POST request, using ZIP data fed from stdin
19+
zip -rq8 - * | curl \
20+
-F "authToken=$TOKEN" \
21+
-F "projectName=$PROJECT_NAME" \
22+
-F "file=@-;filename=upload.zip;type=application/zip" \
2123
$DEST_URL
22-
rm -f $TMP_FILE

0 commit comments

Comments
 (0)