[FIXED] Ubicar carpeta de proyectos dentro de directorio devs
This commit is contained in:
parent
8fbc286d50
commit
e3ce4484dd
1 changed files with 6 additions and 8 deletions
|
@ -82,17 +82,15 @@ fi
|
||||||
# Función para obtener la carpeta de proyectos desde projects.dat
|
# Función para obtener la carpeta de proyectos desde projects.dat
|
||||||
function get_projects_folder() {
|
function get_projects_folder() {
|
||||||
if [ -f "$CONFIG_DIR/projects.dat" ]; then
|
if [ -f "$CONFIG_DIR/projects.dat" ]; then
|
||||||
PROJECT_FOLDER=$(head -n 1 "$CONFIG_DIR/projects.dat")
|
PROJECTS_DIR_NAME=$(head -n 1 "$CONFIG_DIR/projects.dat")
|
||||||
|
|
||||||
# Si la carpeta no comienza con / (ruta absoluta), la convertimos en ruta absoluta
|
|
||||||
if [[ "$PROJECT_FOLDER" != /* ]]; then
|
|
||||||
PROJECT_FOLDER="$HOME/$PROJECT_FOLDER"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
PROJECT_FOLDER="$HOME/proyectos"
|
PROJECTS_DIR_NAME="proyectos"
|
||||||
echo "proyectos" > "$CONFIG_DIR/projects.dat"
|
echo "$PROJECTS_DIR_NAME" > "$CONFIG_DIR/projects.dat"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# La carpeta de proyectos siempre está dentro de devs (BASE_DIR)
|
||||||
|
PROJECT_FOLDER="$BASE_DIR/$PROJECTS_DIR_NAME"
|
||||||
|
|
||||||
# Verificar si la carpeta base de proyectos existe, si no, crearla
|
# Verificar si la carpeta base de proyectos existe, si no, crearla
|
||||||
if [ ! -d "$PROJECT_FOLDER" ]; then
|
if [ ! -d "$PROJECT_FOLDER" ]; then
|
||||||
mkdir -p "$PROJECT_FOLDER"
|
mkdir -p "$PROJECT_FOLDER"
|
||||||
|
|
Loading…
Reference in a new issue