Initialer Commit
This commit is contained in:
commit
c66c85ef68
3 changed files with 68 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
*.log
|
||||||
|
.env
|
||||||
|
node_modules/
|
||||||
1
README.md
Normal file
1
README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# setup_Projekt
|
||||||
64
setup_Projekt.sh
Executable file
64
setup_Projekt.sh
Executable file
|
|
@ -0,0 +1,64 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# --- Konfiguration ---
|
||||||
|
# Das Skript arbeitet in dem Ordner, in dem es gestartet wird.
|
||||||
|
ROOT_DIR=$(pwd)
|
||||||
|
|
||||||
|
echo "--- Projekt-Konfigurator ---"
|
||||||
|
read -p "Name des Projekts: " NAME
|
||||||
|
NAME_CLEAN=${NAME// /_}
|
||||||
|
|
||||||
|
echo -e "\nWelche Art von Projekt?"
|
||||||
|
echo "1) Hardware (3D-Druck/CNC)"
|
||||||
|
echo "2) Software (Python/Bash)"
|
||||||
|
read -p "Auswahl (1 oder 2): " TYPE
|
||||||
|
|
||||||
|
# Tags abfragen (wichtig für die spätere Indizierung)
|
||||||
|
echo -e "\nGib Schlagworte (Tags) für die Suche ein (z.B. Gehäuse Motor Werkzeug):"
|
||||||
|
read -p "Tags: " USER_TAGS
|
||||||
|
|
||||||
|
# Pfad-Logik und Ordner-Erstellung
|
||||||
|
if [ "$TYPE" == "1" ]; then
|
||||||
|
BASE_DIR="01_Hardware_Projekte/$NAME_CLEAN"
|
||||||
|
mkdir -p "$BASE_DIR"/{CAD,CAM,3D_Print,Dokumentation,Ressourcen}
|
||||||
|
CATEGORY="Hardware (3D-Druck/CNC)"
|
||||||
|
elif [ "$TYPE" == "2" ]; then
|
||||||
|
read -p "Sprache (Python/Bash): " LANG
|
||||||
|
if [[ "$LANG" =~ ^[Pp]ython$ ]]; then
|
||||||
|
BASE_DIR="02_Software_Scripts/Python/$NAME_CLEAN"
|
||||||
|
mkdir -p "$BASE_DIR"/{src,tests,docs}
|
||||||
|
touch "$BASE_DIR/src/main.py"
|
||||||
|
CATEGORY="Software (Python)"
|
||||||
|
else
|
||||||
|
BASE_DIR="02_Software_Scripts/Bash/$NAME_CLEAN"
|
||||||
|
mkdir -p "$BASE_DIR"
|
||||||
|
touch "$BASE_DIR/$NAME_CLEAN.sh"
|
||||||
|
chmod +x "$BASE_DIR/$NAME_CLEAN.sh"
|
||||||
|
CATEGORY="Software (Bash)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Ungültige Auswahl. Abbruch."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Voller Pfad zum Zielordner
|
||||||
|
FINAL_PATH="$ROOT_DIR/$BASE_DIR"
|
||||||
|
|
||||||
|
# README.md erstellen und befüllen
|
||||||
|
{
|
||||||
|
echo "# $NAME"
|
||||||
|
echo "Kategorie: $CATEGORY"
|
||||||
|
echo "Erstellt am: $(date +'%d.%m.%Y')"
|
||||||
|
echo -e "\n## Tags zur Indizierung"
|
||||||
|
for tag in $USER_TAGS; do
|
||||||
|
CLEAN_TAG=${tag/#/} # Entfernt evtl. vorhandene # um Dopplungen zu vermeiden
|
||||||
|
echo -n "#$CLEAN_TAG "
|
||||||
|
done
|
||||||
|
echo -e "\n\n## Notizen"
|
||||||
|
echo "- Hier Projektdetails eintragen..."
|
||||||
|
} > "$FINAL_PATH/README.md"
|
||||||
|
|
||||||
|
echo -e "\n--------------------------------------------------"
|
||||||
|
echo "Projekt '$NAME_CLEAN' wurde erfolgreich erstellt!"
|
||||||
|
echo "Pfad: $BASE_DIR"
|
||||||
|
echo "Die README.md wurde mit deinen Tags indiziert."
|
||||||
Loading…
Add table
Reference in a new issue