Skip to content

Commit 66d4a72

Browse files
committed
Fix zip/downloading bugs experimental feature :)
1 parent b8e290d commit 66d4a72

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,4 @@ Simple enough, right?
405405

406406
[screenshot 1]: https://raw.githubusercontent.com/styczynski/bash-universal-tester/master/static/screenshots/screenshot1.png
407407

408-
[link download latest]: https://github.com/styczynski/bash-universal-tester/archive/1.8.0.zip
408+
[link download latest]: https://github.com/styczynski/bash-universal-tester/archive/1.9.0.zip

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bash-universal-tester",
3-
"version": "1.8.0",
3+
"version": "1.9.0",
44
"description": "Universal testing script for bash",
55
"keywords": "bash, testing, tester, utest, bash-test, testing, script",
66
"homepage": "https://github.com/styczynski/bash-universal-tester",

test/utest.yaml

Whitespace-only changes.

utest.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
VERSION="1.8.0"
3+
VERSION="1.9.0"
44
IFS=$'\n'
55

66
# Dependencies
@@ -421,8 +421,17 @@ function update_loc {
421421

422422
function prepare_input {
423423

424-
425424
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
425+
if [[ ! "${param_prog}" = "" ]]; then
426+
if [[ "${param_dir}" = "" ]]; then
427+
if [[ $param_prog =~ $regex ]]
428+
then
429+
param_dir="$param_prog"
430+
param_prog=""
431+
fi
432+
fi
433+
fi
434+
426435
if [[ $param_dir =~ $regex ]]
427436
then
428437
# Link is valid URL so try to download file
@@ -460,6 +469,15 @@ function prepare_input {
460469
stdout "${B_INFO}This may take a while...${E_INFO}\n"
461470
mkdir "$folder_loc"
462471
unzip -q "$param_dir" -d "$folder_loc"
472+
unpackage_status=$?
473+
if [[ ! "$unpackage_status" = "0" ]]; then
474+
unrar "$param_dir" "$folder_loc"
475+
unpackage_status=$?
476+
fi
477+
if [[ ! "$unpackage_status" = "0" ]]; then
478+
unp "$param_dir" "$folder_loc"
479+
unpackage_status=$?
480+
fi
463481
fi
464482

465483
update_loc "$folder_loc"
@@ -475,6 +493,17 @@ function prepare_input {
475493
fi
476494

477495
fi
496+
497+
# Look for utest.yaml inside test directory
498+
if [[ -f "${param_dir}/utest.yaml" ]]; then
499+
if [[ -f "./utest.yaml" ]]; then
500+
stdout "${B_DEBUG}Found utest.yaml inside tests folder. But yaml file is already present.${E_DEBUG}\n"
501+
else
502+
stdout "${B_DEBUG}Found utest.yaml inside tests folder. Copy it.${E_DEBUG}\n"
503+
cp -n "${param_dir}/utest.yaml" "./utest.yaml"
504+
load_global_configuration_file
505+
fi
506+
fi
478507
}
479508

480509
function autofind_tests {

0 commit comments

Comments
 (0)