Skip to content

Commit

Permalink
Reverted fetch-cobolcheck and fetch-cobolcheck.ps1 scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimaDovakin committed Aug 6, 2024
1 parent f2095c6 commit b3583d7
Show file tree
Hide file tree
Showing 94 changed files with 564 additions and 235 deletions.
13 changes: 11 additions & 2 deletions bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/acronym/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/acronym/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/all-your-base/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/all-your-base/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/allergies/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/allergies/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/anagram/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/anagram/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/armstrong-numbers/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/atbash-cipher/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/atbash-cipher/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/binary-search/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/binary-search/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/binary/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/binary/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/bob/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/bob/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
13 changes: 11 additions & 2 deletions exercises/practice/circular-buffer/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It is only used in the cobol track, and a copy of it is placed in every exercise folder.
# If you change something, make sure to upgrade all scripts in all exercises!

set -eo pipefail
# set -eo pipefail

readonly LATEST='https://api.github.com/repos/0xE282B0/cobol-check/releases/latest'

Expand Down Expand Up @@ -45,7 +45,16 @@ get_download_url() {
}

main() {
output_path="/usr/local/bin/cobolcheck${ext}"
if [[ -d ./bin ]]; then
output_dir="./bin"
elif [[ $PWD == */bin ]]; then
output_dir="$PWD"
else
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2
return 1
fi

output_path="${output_dir}/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/circular-buffer/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
Loading

0 comments on commit b3583d7

Please sign in to comment.