planet-wars/frontend/build_games.sh
2019-09-24 15:31:21 +02:00

14 lines
314 B
Bash
Executable file

#!/bin/bash
echo "path=$(pwd | sed 's/.*\/static/static/')/"
for var in "$@"
do
echo
echo "[$var]"
echo "name=$(basename -- "$var" | sed 's/\..*//')"
echo "turns=$(wc -l "$var" | sed 's/ .*//')"
echo "players=$(grep players "$var" | sed 's/"players"://' | tr -d "{}[]'" | tr ',' ' ')"
done