Skip to content

Commit

Permalink
add warning message to bw compat scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Jun 26, 2024
1 parent f7c0b59 commit 7347b75
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions cmd/scripts/argconverter.sh → cmd/scripts/common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# shellcheck disable=SC2034
RED='\033[0;31m'
YEL='\033[1;33m'
NC='\033[0m' # No Color
WARN_STRING="${RED}Warning!${YEL} These backwards compatibilty scripts will soon be deprecated!${NC} Please use, or update your code to use, the scicat-cli executable directly."

function arg_conversion {
args=("$@")

Expand Down
4 changes: 2 additions & 2 deletions cmd/scripts/datasetArchiver
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetArchiver "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetCleaner
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetCleaner "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetGetProposal
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetGetProposal "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetIngestor
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetIngestor "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetPublishData
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetPublishData "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetPublishDataRetrieve
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetPublishDataRetrieve "${modified_args[@]}"
4 changes: 2 additions & 2 deletions cmd/scripts/datasetRetriever
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli datasetRetriever "${modified_args[@]}"
Binary file added cmd/scripts/scicat-cli
Binary file not shown.
4 changes: 2 additions & 2 deletions cmd/scripts/waitForJobFinished
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# shellcheck source=/dev/null
source "$SCRIPT_DIR"/argconverter.sh
source "$SCRIPT_DIR"/common.sh

echo -e "${WARN_STRING}"
modified_args=$(arg_conversion "$@")

"$SCRIPT_DIR"/scicat-cli waitForJobFinished "${modified_args[@]}"

0 comments on commit 7347b75

Please sign in to comment.