Skip to content

Commit

Permalink
feat: Propose to create a subfolder before generating coq-action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmd committed Apr 26, 2020
1 parent e2c9e13 commit c2abac4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

srcdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )

function ask1() { local yn; echo -n "$* [Y/n] "; read -r -n 1 yn; [[ "$yn" =~ [Yy] ]] && echo && return 0; [ -z "$yn" ] && return 0; echo; return 1; }

for f in "$srcdir"/{,.}*.mustache; do
target=$(basename "$f" .mustache)
case "$target" in
*.opam)
shortname=$(grep -e "shortname:" meta.yml | sed -e "s/^shortname: //")
target=${target/coq/coq-$shortname}
;;
coq-action.yml)
ask1 "Do you want to create a .github/workflows subfolder for coq-action.yml?" &&
{ mkdir -p .github/workflows; target=".github/workflows/$target"; }
;;
esac
echo "Generating $target..."
mustache meta.yml "$f" > "$target"
Expand Down

0 comments on commit c2abac4

Please sign in to comment.