mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 17:30:43 +08:00

* only decrypt if the key is available * Use script instead of explicit command * Don't deploy if the keyfile is missing/empty. * Don't deploy if key is not available. * Don't decrypt appveyor key if no secret * wrong name * Fix the logic and a typo
21 lines
425 B
Bash
Executable File
21 lines
425 B
Bash
Executable File
#!/bin/bash
|
|
# Prerequisites
|
|
# Environment Variables:
|
|
# UPLOAD_USER - user to upload to sftp server
|
|
# KEY is assumed to be path to a ssh key for UPLOAD_USER
|
|
|
|
DIR=$1
|
|
shift
|
|
KEY=$1
|
|
shift
|
|
FILES=$*
|
|
|
|
if [ -s $KEY ]; then
|
|
for i in $FILES; do
|
|
filepath=$(readlink -f "$i")
|
|
echo put $filepath | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/"
|
|
done
|
|
else
|
|
echo "$KEY is not available, not deploying."
|
|
fi
|