Skip to content

Commit fac8e33

Browse files
committed
agregar script de shell para automatizar crear STL
1 parent 0facf16 commit fac8e33

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ proyecto inspirado en el chip 555 y el proyecto Atari Punk Console, en su iterac
55
## referencias
66

77
- Oskitone <https://oskitone.com>
8+
- How to Create a Shell Script in linux <https://www.geeksforgeeks.org/how-to-create-a-shell-script-in-linux/>

crear_stls.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# interprete de script
2+
#!/bin/zsh
3+
4+
echo hola $USER
5+
echo "numero de argumentos es $#"
6+
7+
# constantes
8+
9+
# banderas
10+
dir="local/3d-models/$prefix-$timestamp-$commit_hash"
11+
12+
{
13+
14+
function ayuda() {
15+
echo "\
16+
Este script crea archivos STL a partir de archivos .scad
17+
18+
sintaxis:
19+
./crear_stls.sh [opciones]
20+
21+
uso:
22+
./crear_stls.sh exporta todos los archivos STL
23+
./crear_stls.sh -h muestra esta ayuda y cierra
24+
"
25+
}
26+
27+
function exportar_stl() {
28+
echo "testing"
29+
}
30+
31+
function correr() {
32+
mkdir -pv $dir
33+
34+
function terminar() {
35+
# destruir procesos descendientes
36+
pkill -P "$$"
37+
}
38+
trap terminar EXIT
39+
40+
41+
echo "terminado el proceso en X segundos"
42+
}
43+
44+
45+
while getopts "h?b?p:d:e?c?t?q:" opt; do
46+
case "$opt" in
47+
h) help; exit ;;
48+
*) help; exit ;;
49+
esac
50+
done
51+
52+
correr "${query[@]}"
53+
54+
}

0 commit comments

Comments
 (0)