Skip to content

Commit

Permalink
anagram-exercise-fix: Rebased to main and synced all fetch-cobolcheck…
Browse files Browse the repository at this point in the history
… files
  • Loading branch information
SimaDovakin committed Jul 26, 2024
1 parent 9ffb868 commit 08f0c88
Show file tree
Hide file tree
Showing 92 changed files with 393 additions and 739 deletions.
19 changes: 5 additions & 14 deletions exercises/practice/acronym/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
13 changes: 7 additions & 6 deletions exercises/practice/acronym/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1 file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks
# benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1.
# 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!

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Expand All @@ -24,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
19 changes: 5 additions & 14 deletions exercises/practice/all-your-base/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
13 changes: 7 additions & 6 deletions exercises/practice/all-your-base/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1 file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks
# benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1.
# 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!

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Expand All @@ -24,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
11 changes: 1 addition & 10 deletions exercises/practice/allergies/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/allergies/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
11 changes: 1 addition & 10 deletions exercises/practice/anagram/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
4 changes: 3 additions & 1 deletion exercises/practice/anagram/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
11 changes: 1 addition & 10 deletions exercises/practice/armstrong-numbers/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/armstrong-numbers/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
19 changes: 5 additions & 14 deletions exercises/practice/atbash-cipher/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
13 changes: 7 additions & 6 deletions exercises/practice/atbash-cipher/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1 file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks
# benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1.
# 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!

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Expand All @@ -24,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
19 changes: 5 additions & 14 deletions exercises/practice/binary-search/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
13 changes: 7 additions & 6 deletions exercises/practice/binary-search/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1 file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks
# benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1.
# 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!

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Expand All @@ -24,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
19 changes: 5 additions & 14 deletions exercises/practice/binary/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
13 changes: 7 additions & 6 deletions exercises/practice/binary/bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1 file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks
# benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.ps1.
# 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!

$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Expand All @@ -24,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
19 changes: 5 additions & 14 deletions exercises/practice/bob/bin/fetch-cobolcheck
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# This file is a copy of the
# https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet file.
# Please submit bugfixes/improvements to the above file to ensure that all tracks benefit from the changes.
# This file is inspired by https://github.com/exercism/configlet/blob/main/scripts/fetch-configlet.
# 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,16 +45,7 @@ get_download_url() {
}

main() {
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}"
output_path="/usr/local/bin/cobolcheck${ext}"
download_url="$(get_download_url)"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
chmod +x "${output_path}"
Expand Down
Loading

0 comments on commit 08f0c88

Please sign in to comment.