@@ -8,7 +8,7 @@ NEGRITA='\033[1m'
88NC=' \033[0m' # No Color (para resetear)
99
1010echo -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} "
1212echo -e " ${AZUL} Script de instalación para servidor Node.js${NC} "
1313echo -e " ${AMARILLO} Incluye: Express.js, TypeScript, ESLint y Prettier${NC} "
1414echo -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
3333
3434npx tsc --init
3535
36+ sed -i '
37+ # Descomentar rootDir
38+ s/\/\/ *"rootDir": ".\/",/"rootDir": ".\/src",/
39+
40+ # Descomentar outDir
41+ s/\/\/ *"outDir": ".\/",/"outDir": ".\/dist",/
42+ ' tsconfig.json
43+
3644# Función para agregar líneas al final del archivo antes de la última llave
3745add_lines_before_last_brace () {
3846 file=$1
8290
8391echo -e " ${AZUL} \n6) Creamos el archivo .gitignore${NC} "
8492
93+ touch ./.env
8594cat << EOF > .gitignore
8695node_modules
8796.env
@@ -93,10 +102,7 @@ echo -e "${AZUL}\n7) Creamos la estructura de carpetas del proyecto${NC}"
93102mkdir -p src/{routes,controllers,config,interfaces,models,middlewares,services}
94103touch src/config/envs.ts
95104touch src/routes/indexRouter.ts
96- touch src/routes/userRouter.ts
97- touch src/routes/appointmentRouter.ts
98105touch src/controllers/userRouter.ts
99- touch src/controllers/appointmentRouter.ts
100106
101107echo -e " ${AZUL} \n8) Agregamos los archivos index.ts y server.ts${NC} "
102108
@@ -150,6 +156,9 @@ npx json -I -f package.json -e 'this.scripts.build="tsc"'
150156npx json -I -f package.json -e ' this.scripts.lint="eslint . --ext .ts"'
151157npx json -I -f package.json -e ' this.scripts["lint:fix"]="eslint . --ext .ts --fix"'
152158
159+ PACKAGE_JSON=" ./package.json"
160+ sed -i ' s/\^//g' " $PACKAGE_JSON "
161+
153162echo -e " ${VERDE} =========================================================${NC} "
154163echo -e " ${ROJO} ${NEGRITA} Seguinos en Github:${NC} "
155164echo -e " ${ROJO} ${NEGRITA} https://github.com/mnibor${NC} "
0 commit comments