Projet

Général

Profil

Révision c541cb82

Ajouté par Julien Enselme il y a environ 7 ans

d7-sync-site.sh: set correct path for file system on destination script

Voir les différences:

bin/d7-sync-site.sh
73 73

  
74 74
# Sync databases
75 75
## Save file system
76
if [ -z "${new_site}" ] ; then
77
    private_path=$(drush "@${dest_site_name}" vget --format=string file_private_path 2> /dev/null)
78
    public_path=$(drush "@${dest_site_name}" vget --format=string file_public_path 2> /dev/null)
79
    temp_path=$(drush "@${dest_site_name}" vget --format=string file_temporary_path 2> /dev/null)
80
fi
76
private_path=$(drush "@${source_site_name}" vget --format=string file_private_path 2> /dev/null)
77
public_path=$(drush "@${source_site_name}" vget --format=string file_public_path 2> /dev/null)
78
temp_path=$(drush "@${source_site_name}" vget --format=string file_temporary_path 2> /dev/null)
81 79

  
82 80
## Sync
83 81
current_date=$(date "+%Y-%m-%d-%Hh%Mm%Ss")
......
90 88
rm "${sql_file}"
91 89

  
92 90
## Restore file system
91
### Fix values for default sites/default/files must become sites/assos.centrale-marseille.fr.SITE/files
92
### For the others sites/assos.centrale-marseille.fr.SITE/files must become assos.centrale-marseille.fr.OTHER_SITE/files
93
if [ "${source_site_name}" = "default" ]; then
94
    dest_path_name="assos.centrale-marseille.fr.${dest_site_name}"
95
else
96
    dest_path_name="${dest_site_name}"
97
fi
98

  
99
if [ "${dest_site_name}" = "default" ]; then
100
   souce_path_name="assos.centrale-marseille.fr.${source_site_name}"
101
else
102
   source_path_name="${source_site_name}"
103
fi
104

  
93 105
if [ -n "${private_path}" ] ; then
106
    private_path="${private_path/${source_path_name}/${dest_path_name}}"
94 107
    drush -y "@${dest_site_name}" vset file_private_path "${private_path}"
95 108
fi
96 109
if [ -n "${public_path}" ] ; then
110
    public_path="${public_path/${source_path_name}/${dest_path_name}}"
97 111
    drush -y "@${dest_site_name}" vset file_public_path "${public_path}"
98 112
fi
99 113
if [ -n "${temp_path}" ] ; then
114
    temp_path="${temp_path/${source_path_name}/${dest_path_name}}"
100 115
    drush -y "@${dest_site_name}" vset file_temporary_path "${temp_path}"
101 116
fi
102 117

  

Formats disponibles : Unified diff