@@ -8,7 +8,7 @@ NEGRITA='\033[1m'
8
8
NC=' \033[0m' # No Color (para resetear)
9
9
10
10
echo -e " ${VERDE} =========================================================${NC} "
11
- echo -e " ${AZUL} ${NEGRITA} netepScript - V 0.8.9 ${NC} "
11
+ echo -e " ${AZUL} ${NEGRITA} netepScript - V 0.8.10 ${NC} "
12
12
echo -e " ${AZUL} Script de instalación para servidor Node.js${NC} "
13
13
echo -e " ${AMARILLO} Incluye: Express.js, TypeScript, ESLint y Prettier${NC} "
14
14
echo -e " ${ROJO}${NEGRITA} Autores: Marcelo Robin / Jesús García${NC} "
@@ -33,6 +33,14 @@ echo -e "${AZUL}\n4) Generamos el tsconfig.json con las opciones por defecto${NC
33
33
34
34
npx tsc --init
35
35
36
+ sed -i '
37
+ # Descomentar rootDir
38
+ s/\/\/ *"rootDir": ".\/",/"rootDir": ".\/src",/
39
+
40
+ # Descomentar outDir
41
+ s/\/\/ *"outDir": ".\/",/"outDir": ".\/dist",/
42
+ ' tsconfig.json
43
+
36
44
# Función para agregar líneas al final del archivo antes de la última llave
37
45
add_lines_before_last_brace () {
38
46
file=$1
82
90
83
91
echo -e " ${AZUL} \n6) Creamos el archivo .gitignore${NC} "
84
92
93
+ touch ./.env
85
94
cat << EOF > .gitignore
86
95
node_modules
87
96
.env
@@ -93,10 +102,7 @@ echo -e "${AZUL}\n7) Creamos la estructura de carpetas del proyecto${NC}"
93
102
mkdir -p src/{routes,controllers,config,interfaces,models,middlewares,services}
94
103
touch src/config/envs.ts
95
104
touch src/routes/indexRouter.ts
96
- touch src/routes/userRouter.ts
97
- touch src/routes/appointmentRouter.ts
98
105
touch src/controllers/userRouter.ts
99
- touch src/controllers/appointmentRouter.ts
100
106
101
107
echo -e " ${AZUL} \n8) Agregamos los archivos index.ts y server.ts${NC} "
102
108
@@ -150,6 +156,9 @@ npx json -I -f package.json -e 'this.scripts.build="tsc"'
150
156
npx json -I -f package.json -e ' this.scripts.lint="eslint . --ext .ts"'
151
157
npx json -I -f package.json -e ' this.scripts["lint:fix"]="eslint . --ext .ts --fix"'
152
158
159
+ PACKAGE_JSON=" ./package.json"
160
+ sed -i ' s/\^//g' " $PACKAGE_JSON "
161
+
153
162
echo -e " ${VERDE} =========================================================${NC} "
154
163
echo -e " ${ROJO} ${NEGRITA} Seguinos en Github:${NC} "
155
164
echo -e " ${ROJO} ${NEGRITA} https://github.com/mnibor${NC} "
0 commit comments