diff options
author | EuAndreh <eu@euandre.org> | 2020-10-10 15:02:50 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-10-10 15:02:50 -0300 |
commit | 6bded031dd6eb0900f12f94e3d490fc574b73f6f (patch) | |
tree | ba9a8131490f84ac5d5c66842aee45b91c392bd7 | |
parent | Enforce all "post" and "pastebin" layouts have dates in filenames (diff) | |
download | euandre.org-6bded031dd6eb0900f12f94e3d490fc574b73f6f.tar.gz euandre.org-6bded031dd6eb0900f12f94e3d490fc574b73f6f.tar.xz |
Remove unused scripts
Diffstat (limited to '')
-rwxr-xr-x | scripts/missing-translations.sh | 61 | ||||
-rwxr-xr-x | scripts/test-hook.sh | 23 |
2 files changed, 0 insertions, 84 deletions
diff --git a/scripts/missing-translations.sh b/scripts/missing-translations.sh deleted file mode 100755 index 699c6dd..0000000 --- a/scripts/missing-translations.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -end="\033[0m" -red="\033[0;31m" -red() { echo -e "${red}${1}${end}"; } - -JSON="${1:-}" -[[ -z "${JSON}" ]] && { - red 'Missing input JSON file.' - cat <<EOF -Usage: - $0 <SITE_JSON_PATH> - - Arguments - SITE_JSON_PATH Path to the site.json file which contains data and metadata about pages of the site. - -Examples: - $0 _site/site.json - $0 result/site.json - $0 \$(nix-build -A subtasks.docs)/site.json -EOF - exit 2 -} - -get-ref() { - echo "${1}" | base64 --decode | jq -r .ref -} - -get-lang() { - echo "${1}" | base64 --decode | jq -r .lang -} - -declare -A IDENTS -declare -A ALL_REFS -accumulate-translation-identifiers() { - SELECTOR="${1}" - for page in $(jq -r "${SELECTOR} | @base64" "${JSON}"); do - REF="$(get-ref "$page")" - LANG="$(get-lang "$page")" - if [[ -n "${REF}" ]]; then - ALL_REFS["${REF}"]=1 - IDENTS["${REF}:${LANG}"]=1 - fi - done -} - -accumulate-translation-identifiers '.posts[]' -accumulate-translation-identifiers '.pages[]' -accumulate-translation-identifiers '.tils[]' - -LANGS=(en pt fr) - -for ref in "${!ALL_REFS[@]}"; do - REF="$(cut -d: -f1 <(echo "${ref}"))" - for lang in "${LANGS[@]}"; do - if [[ "${IDENTS[${ref}:${lang}]:-}" != 1 ]]; then - echo "ref '${ref}' is missing language '${lang}'." - fi - done -done diff --git a/scripts/test-hook.sh b/scripts/test-hook.sh deleted file mode 100755 index 64ca6b9..0000000 --- a/scripts/test-hook.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -WORK_TREE="$(mktemp -d)" -COMMIT="$(git rev-parse master)" -git --work-tree="$WORK_TREE" checkout -f master -cd "$WORK_TREE" - -LOGS_PREFIX="/data/static/ci-logs" -LOGS_DIR="${LOGS_PREFIX}/website" -mkdir -p "$LOGS_DIR" - -LOGFILE="${LOGS_DIR}/$(date -Is)-${COMMIT}.log" - -touch "${LOGFILE}" -"${LOGS_PREFIX}"/ci-gen-index.sh - -finish() { - printf "\n\n>>> exit status was %s\n" "$1" >> "$LOGFILE" -} -trap finish EXIT - -nix-build -A test 2>&1 | tee "$LOGFILE" |