61d8460149
12 funciones Bash del dominio shell: utilidades de scripting (bash_log, bash_colors, bash_check_deps, bash_confirm, bash_handle_error, bash_safe_run), manipulacion de texto (convert_text_case), estructura de proyectos (create_project_structure), y operaciones git (git_clean_branches, git_log_visual, git_push_all_remotes, git_repo_status). Cada una con su .sh y .md de frontmatter.
2.2 KiB
2.2 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, source_repo, source_license, source_file
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | source_repo | source_license | source_file | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bash_check_deps | function | bash | shell | 1.0.0 | impure | check_command(cmd: string, [error_code: string], [description: string]) -> void; check_commands(cmd...: string) -> void; check_directory(dir: string, [msg: string]) -> void; check_file(file: string, [msg: string]) -> void | Verifica existencia de comandos, directorios y archivos con output formateado. Complementa assert_command_exists con mensajes de error detallados y logging. |
|
|
false | error_go_core |
|
exit code 0 si todas las verificaciones pasan; exit code 1 en caso de fallo con mensaje de error formateado | false | bash/functions/shell/bash_check_deps.sh | https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git | MIT | scripts/lib/common.sh |
Ejemplo
source bash/functions/shell/bash_check_deps.sh
check_command "docker" "DOCKER_NOT_FOUND" "Docker no esta instalado"
check_commands "git" "curl" "jq"
check_directory "/var/data" "El directorio de datos no existe"
check_file "/etc/config.yaml" "Falta el archivo de configuracion"
Notas
check_command acepta un error_code y descripcion opcionales para mensajes mas descriptivos que assert_command_exists. Usa debug internamente para loggear cada verificacion.
check_commands verifica multiples comandos en una sola llamada y reporta todos los faltantes antes de retornar 1.
Sourcea bash_log.sh automaticamente, que a su vez sourcea bash_colors.sh. No es necesario sourcea dependencias por separado.