Skip to content

Commit

Permalink
Merge pull request #5 from os-climate/update-pyproject-toml-links
Browse files Browse the repository at this point in the history
Fix: Update web links in pyproject.toml [skip ci]
  • Loading branch information
ModeSevenIndustrialSolutions authored Jan 19, 2024
2 parents 0fe80d0 + 0be39f2 commit 17b118e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/os-climate/osc-data-extraction"
Repository = "https://github.com/os-climate/osc-data-extraction"
Downloads = "https://github.com/os-climate/osc-data-extraction/releases"
"Bug Tracker" = "https://github.com/os-climate/osc-data-extraction/issues"
Documentation = "https://github.com/os-climate/osc-data-extraction/tree/main/docs"
"Source Code" = "https://github.com/os-climate/osc-data-extraction"
Homepage = "https://github.com/os-climate/osc-transformer-based-extractor"
Repository = "https://github.com/os-climate/osc-transformer-based-extractor"
Downloads = "https://github.com/os-climate/osc-transformer-based-extractor/releases"
"Bug Tracker" = "https://github.com/os-climate/osc-transformer-based-extractor/issues"
Documentation = "https://github.com/os-climate/osc-transformer-based-extractor/tree/main/docs"
"Source Code" = "https://github.com/os-climate/osc-transformer-based-extractor"

[build-system]
requires = ["pdm-backend"]
Expand Down
28 changes: 23 additions & 5 deletions scripts/template-to-repo.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/bash

# set -x
# set -x

THIS_SCRIPT=$(basename "$0")
echo "This script: $SELF"

TEMPLATE_NAME=osc-data-extraction
ALT_TEMPLATE_NAME="${TEMPLATE_NAME//-/_}"

### Shared functions

# Renames files/folders containing template name
rename_object() {
if [ $# -ne 1 ]; then
echo "Function requires an argumeent: rename_object [filesystem object]"; exit 1
echo "Function requires an argument: rename_object [filesystem object]"; exit 1
else
FS_OBJECT="$1"
fi
Expand Down Expand Up @@ -48,6 +54,21 @@ file_content_substitution() {
else
FILENAME="$1"
fi

# Do not modify self!
BASE_FILENAME=$(basename "$FILENAME")
if [ "$BASE_FILENAME" = "$THIS_SCRIPT" ]; then
echo "Skipping self: $THIS_SCRIPT"
return
fi

if [ "$BASE_FILENAME" != "pyproject.toml" ]; then
return
else
echo "Processing: pyproject.toml"
set -x
fi

COUNT=0
if (grep "$TEMPLATE_NAME" "$FILENAME" > /dev/null 2>&1); then
MATCHES=$(grep -c "$TEMPLATE_NAME" "$FILENAME")
Expand Down Expand Up @@ -80,9 +101,6 @@ file_content_substitution() {

### Main script entry point

TEMPLATE_NAME=osc-transformer-based-extractor
ALT_TEMPLATE_NAME="${TEMPLATE_NAME//-/_}"

if ! (git rev-parse --show-toplevel > /dev/null); then
echo "Error: this folder is not part of a GIT repository"; exit 1
fi
Expand Down

0 comments on commit 17b118e

Please sign in to comment.