#!/usr/bin/env bash # Gera a pagina de jogos de PuzzleScript de terceiros (MIT e GPL-3.0, repositorios proprios dos autores): Orpheus e Bankoso # (henriquelalves), Colour Chained, A Cog's Life, "Let's Part, E" e ScriptCross (Dennis Au, mechturk) e # Ravvle (vvroul, GPL-3.0). Usa o mesmo molde e o mesmo puzzlescript/make.py de build-puzzlescript-games.sh (standalone_inlined.txt # do increpare/PuzzleScript no commit 57f9f6c, sem riffwave GPL, sem link do autor, com CSP), so que o texto do jogo vem do # repositorio do autor, no commit pinado e conferido pelo sha256. # # src/FredGames.Bundler/Builds/build-puzzlescript-community.sh # # Saida: artifacts/build/puzzlescript-community/.html (+ .txt e .LICENSE). Roda duas vezes com o mesmo resultado. set -euo pipefail ENGINE=57f9f6cba69f6aa52ed738d5aee1d709d0037648 ENGINE_SHA256=b7ac66e3610865573a44dd8625300d8a95c024dc39c0ef0a18fd61eeee72bbdd here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root="$(git -C "$here" rev-parse --show-toplevel 2>/dev/null || pwd)" out="$root/artifacts/build/puzzlescript-community" cache="$root/artifacts/build/cache" mkdir -p "$cache" "$out" fetch() { # url destino if [ ! -f "$2" ]; then curl -fsSL --retry 4 "$1" -o "$2.partial" && mv "$2.partial" "$2"; fi } tar_gz="$cache/puzzlescript-${ENGINE:0:7}.tar.gz" fetch "https://github.com/increpare/PuzzleScript/archive/$ENGINE.tar.gz" "$tar_gz" echo "$ENGINE_SHA256 $tar_gz" | shasum -a 256 -c - tree="$out/tree" rm -rf "$tree"; mkdir -p "$tree" tar -xzf "$tar_gz" -C "$tree" --strip-components 1 # slug repositorio commit arquivo sha256-do-arquivo arquivo-da-licenca sha256-da-licenca while read -r slug repo commit file sha lic licsha; do c="$cache/ps-community-$slug" fetch "https://raw.githubusercontent.com/$repo/$commit/$file" "$c.txt" echo "$sha $c.txt" | shasum -a 256 -c - fetch "https://raw.githubusercontent.com/$repo/$commit/$lic" "$c.LICENSE" echo "$licsha $c.LICENSE" | shasum -a 256 -c - python3 -I "$here/puzzlescript/make.py" "$tree/src/standalone_inlined.txt" "$c.txt" "$slug" black lightblue \ "$here/puzzlescript/riffwave.js" "$out/$slug.html" cp "$c.txt" "$out/$slug.txt" cp "$c.LICENSE" "$out/$slug.LICENSE" done <<'LIST' orpheus henriquelalves/Orpheus c296faad00fa7516e19b99f1503bec1129ea02ff game.puzzlescript ca2934ecd4aab517647d750eaebccb1871da840462ad3230a439f15195c60aa2 LICENSE ade4fe1c44321d431b22923155fe262a276762d1ac246c27c7db6c44662a5eb5 bankoso henriquelalves/Bankoso eb891304eb8c980a6c2dc1ba62199171142c1959 game.puzzlescript 9f04f7a3caebc5d5d9f3d6761c9cbce4d5a2e8049e6b3523330651992b830780 LICENSE ade4fe1c44321d431b22923155fe262a276762d1ac246c27c7db6c44662a5eb5 colour-chained mechturk/PuzzlescriptGames 823c4536ff2acf3aed096e10d49b4f62bfca4e2b ColourChained.txt f11cb40c4e5a7f6b6d02a20bd039718966963ab579b604d505eb3206e6595657 LICENSE.md b1f874de82edd7e1eeac0f0487f56a095f211b2df157739b7f0b9baecac32236 a-cogs-life mechturk/PuzzlescriptGames 823c4536ff2acf3aed096e10d49b4f62bfca4e2b CogsLife.txt db5164adf4edd9992bee4959499778438f2781fa7ebc2a6953dbb79d3dcc7bfb LICENSE.md b1f874de82edd7e1eeac0f0487f56a095f211b2df157739b7f0b9baecac32236 lets-part-e mechturk/PuzzlescriptGames 823c4536ff2acf3aed096e10d49b4f62bfca4e2b LetsPartE.txt 66d3e48d7c6ff3f2c46c3aa2ce8c744653c60024e095a7c6314552163102d9d7 LICENSE.md b1f874de82edd7e1eeac0f0487f56a095f211b2df157739b7f0b9baecac32236 scriptcross mechturk/PuzzlescriptGames 823c4536ff2acf3aed096e10d49b4f62bfca4e2b Scriptcross.txt 4efa3e6bb2a7558d6b9c7a98a48d1313f69fbbcfc227623eb9b546d8ac9fad9c LICENSE.md b1f874de82edd7e1eeac0f0487f56a095f211b2df157739b7f0b9baecac32236 ravvle vvroul/ravvle cca6e2eb440ae1241b6c67474e0e32e28f272939 Ravvle.md af5b685d1939bea1f5a52753aed6e7f9e4ea6b393a4aedd83dcaab2e67cd2fd6 LICENSE 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LIST rm -rf "$tree" shasum -a 256 "$out"/*.html