From 0be39f23625c4fbc1e2a401d09c482ccc28868c4 Mon Sep 17 00:00:00 2001 From: Matthew Watkins Date: Fri, 19 Jan 2024 16:58:09 +0000 Subject: [PATCH] Fix: Update web links in pyproject.toml [skip ci] Signed-off-by: Matthew Watkins --- pyproject.toml | 12 ++++++------ scripts/template-to-repo.sh | 28 +++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3dd685c..38d3c85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/scripts/template-to-repo.sh b/scripts/template-to-repo.sh index f29f65b..bc4a2ab 100755 --- a/scripts/template-to-repo.sh +++ b/scripts/template-to-repo.sh @@ -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 @@ -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") @@ -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