forked from aellacredit/algo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·28 lines (27 loc) · 996 Bytes
/
run.sh
File metadata and controls
executable file
·28 lines (27 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
projects=("kola-go" "kola-js" "kola-rs")
if [ -z "$1" ]; then
echo "question name required"
exit 1
fi
export question=$(echo "$1" | iconv -t ascii//TRANSLIT | sed -E 's/[~\^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+\|-+$//g' | sed -E 's/^-+//g' | sed -E 's/-+$//g' | tr A-Z a-z)
# if [ ! -e "/run.sh" ] > /dev/null; then
# echo "you must be in the root directory of the project"
# exit 1
# fi
# mkdir -p "./questions/$question"
mkdir -p "./questions/$question/solutions"
echo "## $1" > "./questions/$question/index.md"
if [ "$2" ]; then
echo -e "\n$2" >> "./questions/$question/index.md"
fi
for i in $projects; do
mkdir -p "./questions/$question/solutions/$i"
if [ -d "./templates/$i" ]; then
# echo "./templates/$i"
cp -n -R "./templates/$i/" "./questions/$question/solutions/$i"
fi
done
echo "cd ./questions/$question/solutions/${projects[0]}"
cd "./questions/$question/solutions/${projects[0]}"
# gotests -all -w -parallel .