omegaupload/bin/upload_test_files.sh

22 lines
418 B
Bash
Raw Normal View History

2021-10-31 02:53:43 -07:00
#!/usr/bin/env bash
source .env
cd "$(git rev-parse --show-toplevel)" || exit 1
cargo build --release --bin omegaupload-cli
TEST_PATH="test/*"
PADDING=0
for file in $TEST_PATH; do
if [ $PADDING -lt ${#file} ]; then
PADDING=${#file}
fi
done
for file in $TEST_PATH; do
2021-10-31 11:44:46 -07:00
printf "%$((PADDING - ${#TEST_PATH} + 1))s: " "${file#$TEST_PATH}"
2021-10-31 02:53:43 -07:00
./target/release/omegaupload-cli upload "$PASTE_URL" "$file"
done