Skip to content

Commit

Permalink
Attempt to fix the problem with tests in the web editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimaDovakin committed Aug 29, 2024
1 parent 6c52fb9 commit c196812
Show file tree
Hide file tree
Showing 94 changed files with 470 additions and 94 deletions.
6 changes: 5 additions & 1 deletion bin/exercise_test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion bin/exercise_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/acronym/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/acronym/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/all-your-base/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/all-your-base/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/allergies/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/allergies/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/anagram/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/anagram/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/armstrong-numbers/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/armstrong-numbers/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/atbash-cipher/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/atbash-cipher/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/binary-search/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/binary-search/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/binary/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/binary/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/bob/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/bob/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/circular-buffer/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/circular-buffer/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/collatz-conjecture/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/collatz-conjecture/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/complex-numbers/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/complex-numbers/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/darts/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/darts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/diamond/test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
$slug=Split-Path $PSScriptRoot -Leaf
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue

if (![System.IO.File]::Exists("$cobolcheck")){
if ($cobolcheckCmd) {
$cobolcheck = $cobolcheckCmd.Path
Write-Output "Found cobolcheck, using $cobolcheck"
} elseif (![System.IO.File]::Exists("$cobolcheck")){
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
echo $fetchCobolcheckPath
Write-Output "Cobolcheck not found. Trying to fetch it."
Expand Down
6 changes: 5 additions & 1 deletion exercises/practice/diamond/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"

if [ ! -f "${COBOLCHECK}" ]; then
WHICH_COBOLCHECK=$(which cobolcheck)
if [[ $? -eq 0 ]] ; then
echo "Found cobolcheck, using $COBOLCHECK"
COBOLCHECK=$WHICH_COBOLCHECK
elif [ ! -f "${COBOLCHECK}" ]; then
echo "Cobolcheck not found, try to fetch it."
cd $SCRIPT_DIR/bin/
bash fetch-cobolcheck
Expand Down
Loading

0 comments on commit c196812

Please sign in to comment.