Sebastian Mark
5e9eba97f4
- create `makeday.sh` script to set up project directories
- generate `main.go` and `main.py` templates with basic structure
- add input file creation for the specified or current day
- include author information and license in script and templates
🤖
55 lines
864 B
Bash
Executable file
55 lines
864 B
Bash
Executable file
#! /bin/bash
|
|
# vim: ts=2:sw=2:sts=2:tw=95:ai:fo+=ro
|
|
|
|
## Author: Sebastian Mark
|
|
## CC-BY-SA (https://creativecommons.org/licenses/by-sa/4.0/deed.de)
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
YEAR=$(date +%Y)
|
|
DAY=$(date +%d)
|
|
T=${YEAR}/${DAY}
|
|
else
|
|
T=$1
|
|
fi
|
|
|
|
mkdir -p $T
|
|
touch ${T}/input
|
|
|
|
cat <<EOT >${T}/main.go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"aoc/helper"
|
|
)
|
|
|
|
func main() {
|
|
}
|
|
EOT
|
|
|
|
cat <<EOT >${T}/main.py
|
|
#!/usr/bin/env python
|
|
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
|
|
|
# Author: Sebastian Mark
|
|
# CC-BY-SA (https://creativecommons.org/licenses/by-sa/4.0/deed.de)
|
|
|
|
# pylint: disable=missing-module-docstring,missing-function-docstring,consider-using-f-string
|
|
|
|
|
|
def readinput():
|
|
with open("input", "r", encoding="utf-8") as file:
|
|
lines = file.readlines()
|
|
return lines
|
|
|
|
|
|
def main():
|
|
pass
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
EOT
|
|
|
|
echo "initialized $T"
|