From 0b24f26988877c23201ba2624839b26166c09fca Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 27 Apr 2023 17:55:50 +0800 Subject: [PATCH] Delete openring-create script --- bin/openring-create | 80 --------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 bin/openring-create diff --git a/bin/openring-create b/bin/openring-create deleted file mode 100644 index ec1ba67..0000000 --- a/bin/openring-create +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -p openring -i bash - -function help() { -cat << HELP -Simply creates an output from an openring template. - -Usage: [options] [input_file] -- [openring_args] - -Options: - -h, --help Help. - -l, --limit The number of posts to be shown. - -d, --data The file path of a JSON file containing an - array of URLs (as strings). - -o, --output The output file path. - If there's no output value given, the resulting - output name will be '\$INPUT.out'. - -i, --input The input file path. - -You can also pass arguments to openring as if executing the -program itself by prepending them with double dash. -Make sure, they are the last one. -HELP -} - -# The default values. -LIMIT=5 - -INPUT_TEMPLATE="./assets/templates/openring-input.html" -input_file=$(basename "$INPUT_TEMPLATE") -input_file_ext="${input_file##*.}" -input_file="${input_file%.*}" - -OUTPUT="$input_file.out.$input_file_ext" -DATA="data/blogs.json" - -while [[ "$#" -gt 0 ]]; do - case "$1" in - -h|--help) - help - exit 0 - ;; - -l|--limit) - LIMIT="$2" - shift 2 - ;; - -d|--data) - DATA="$2" - shift 2 - ;; - -o|--output) - OUTPUT="$2" - shift 2 - ;; - -i|--input) - INPUT_TEMPLATE="$2" - shift 2 - ;; - --) - shift - OPENRING_ARGS="$@" - shift $# - ;; - *) - INPUT_TEMPLATE="$1" - shift - ;; - esac -done - -OPENRING="openring $OPENRING_ARGS"; - -for feed in $(jq ".[]" "$DATA" | shuf --head-count $LIMIT); do - OPENRING="$OPENRING -s $feed"; -done - -OPENRING="$OPENRING -n $LIMIT < $INPUT_TEMPLATE > $OUTPUT" - -echo "$OPENRING" -eval $OPENRING