Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix the problem with tests in the web editor. #162

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading