From 4e9f4c608e2d1b4debd5fa4eb7857ce9892fef57 Mon Sep 17 00:00:00 2001 From: Marucci Maximo Date: Sat, 30 Mar 2024 02:01:56 -0300 Subject: [PATCH] fix (symfony): #33 fix permissions implemention --- console/common/tasks/command_line | 2 +- .../symfony/environment/docker-compose.yml | 1 - console/implemention/symfony/props/menu | 20 ++++++++++--------- console/implemention/symfony/tasks/main | 3 ++- console/implemention/symfony/tasks/menu | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/console/common/tasks/command_line b/console/common/tasks/command_line index fd96195..8a3afc3 100644 --- a/console/common/tasks/command_line +++ b/console/common/tasks/command_line @@ -33,7 +33,7 @@ _mod_.run() { if [ "${FORCE_SHOW_OUTPUT}" = "true" ]; then eval "${COMMAND_LINE}" else - eval "${COMMAND_LINE}" > /dev/null 2>&1 + eval "${COMMAND_LINE}" > /dev/null 2>&1 fi } diff --git a/console/implemention/symfony/environment/docker-compose.yml b/console/implemention/symfony/environment/docker-compose.yml index 81b6d97..462541a 100755 --- a/console/implemention/symfony/environment/docker-compose.yml +++ b/console/implemention/symfony/environment/docker-compose.yml @@ -40,7 +40,6 @@ services: depends_on: ['database'] networks: ['symfony'] - database: image: 'mariadb:10.11.2' restart: always diff --git a/console/implemention/symfony/props/menu b/console/implemention/symfony/props/menu index eb1d28b..8a87c06 100644 --- a/console/implemention/symfony/props/menu +++ b/console/implemention/symfony/props/menu @@ -1,21 +1,23 @@ #!/usr/bin/env bash { # shellcheck disable=SC2168 - local PATH_MENU="symfony.tasks" + local IMPLEMENT="Symfony" + # shellcheck disable=SC2168 + local PATH_MENU="${IMPLEMENT,,}.tasks" - _mod_TITLE="Symfony https://symfony.com/ \nSelect an option:" + _mod_TITLE="$IMPLEMENT https://symfony.com/ \nSelect an option:" _mod_MAIN=( - "symfony:project:config, $PATH_MENU.menu.show_config_project, Project config, Settings established in the project" - "symfony:console, $PATH_MENU.menu.console, Console, Symfony Console" - "symfony:docker, docker.tasks.menu.main, Docker, Dockerization management in the project" - "symfony:permissions:fix, $PATH_MENU.symfony_fix_permissions, Fix permissions, Apply permissions" - "symfony:database, mysql.tasks.menu.main, Database, Database Manager" + "${IMPLEMENT,,}:project:config, $PATH_MENU.menu.show_config_project, Project config, Settings established in the project" + "${IMPLEMENT,,}:console, $PATH_MENU.menu.console, Console, $IMPLEMENT Console" + "${IMPLEMENT,,}:docker, docker.tasks.menu.main, Docker, Dockerization management in the project" + "${IMPLEMENT,,}:permissions:fix, $PATH_MENU.menu.fix_permissions, Fix permissions, Apply permissions" + "${IMPLEMENT,,}:database, mysql.tasks.menu.main, Database, Database Manager" ) _mod_CREATE_ENVIRONMENT=( - "symfony:create, $PATH_MENU.install.create_new_environment, Create new app, " - "symfony:clone, $PATH_MENU.install.clone_environment, Clone existing app, Clone from http://url.repository" + "${IMPLEMENT,,}:create, $PATH_MENU.install.create_new_environment, Create new app, " + "${IMPLEMENT,,}:clone, $PATH_MENU.install.clone_environment, Clone existing app, Clone from http://url.repository" ) _mod_CREATE_ENVIRONMENT_VERSION=( diff --git a/console/implemention/symfony/tasks/main b/console/implemention/symfony/tasks/main index 4668812..59813e5 100644 --- a/console/implemention/symfony/tasks/main +++ b/console/implemention/symfony/tasks/main @@ -10,7 +10,8 @@ _mod_.run_command_app_cli(){ _mod_.permissions_fix(){ local PATH_APP="./app" ! common.tasks.directory.exists "$PATH_APP" && common.tasks.directory.create_recursive "$PATH_APP" - common.tasks.command_line.run true false "sudo chown -R $USER:$USER $PATH_APP" + sleep 2 # Important: Probably when the permissions are applied, the construction of the directories is not finished + common.tasks.command_line.run true false "sudo chown -R $UID $PATH_APP" } _mod_.symfony_console_run_command(){ diff --git a/console/implemention/symfony/tasks/menu b/console/implemention/symfony/tasks/menu index 43a2971..ca7e7f3 100644 --- a/console/implemention/symfony/tasks/menu +++ b/console/implemention/symfony/tasks/menu @@ -23,7 +23,7 @@ set -euo pipefail fi } - _mod_.symfony_fix_permissions(){ + _mod_.fix_permissions(){ symfony.tasks.main.permissions_fix _mod_.main }