Project

General

Profile

Revision ad4e6a76

Added by Julien Enselme over 7 years ago

Correct sites_list after drush update

View differences:

bin/scripts-utils.sh
128 128
}
129 129

  
130 130
sites_list() {
131
    # The commands output assos.centrale-marseille.fr/<site-name> or assos.centrale-marseille.fr (default).
132
    # Since we want only the site name (and default for default), we replace assos.centrale-marseille.fr by
133
    # assos.centrale-marseille.fr/default so it si like other site. We then use awk to split the strip on /
134
    # and get only the site name.
131 135
    # grep -v "^self$" is used to remove self that appear if command is launched in one of drupal directories
132
    drush sa --format=csv --fields="name","uri" | awk '{FS=","; if ($2 != "") { print $1;}}' | sort | grep -v "^self$"
136
    drush sa --format=csv --fields="name","uri" |
137
        sed 's#^assos.centrale-marseille.fr$#asoss.centrale-marseille.fr/default#' |
138
        awk '{if ($1 != "") { split($1, a, "/"); print a[2];}}' |
139
        sort |
140
        grep -v "^self$"
133 141
}

Also available in: Unified diff