|
94 | 94 | ) |
95 | 95 | echo "$corrected_versions" >> source/conf.py |
96 | 96 | fi |
97 | | - |
| 97 | + |
| 98 | + if [ "$current_version" = "v1.6.0" ] || \ |
| 99 | + [ "$current_version" = "v1.7.0" ] || \ |
| 100 | + [ "$current_version" = "v1.8.0" ] || \ |
| 101 | + [ "$current_version" = "v1.9.0" ] || \ |
| 102 | + [ "$current_version" = "v1.10.0" ] || \ |
| 103 | + [ "$current_version" = "v1.11.0" ] || \ |
| 104 | + [ "$current_version" = "v1.11.1" ] || \ |
| 105 | + [ "$current_version" = "v1.12.0" ] || \ |
| 106 | + [ "$current_version" = "v1.13.0" ] || \ |
| 107 | + [ "$current_version" = "v1.13.1" ] || \ |
| 108 | + [ "$current_version" = "v1.14.0" ] || \ |
| 109 | + [ "$current_version" = "v1.15.0" ] || \ |
| 110 | + [ "$current_version" = "v1.15.1" ] || \ |
| 111 | + [ "$current_version" = "v1.15.2" ]; then |
| 112 | + awk ' |
| 113 | + # when we see the start of the old block, switch mode |
| 114 | + /html_context\["versions"\] = list\(\)/ { |
| 115 | + print "html_context[\"versions\"] = list()" |
| 116 | + print "versions = sorted(" |
| 117 | + print " [" |
| 118 | + print " tag.name" |
| 119 | + print " for tag in repo.tags" |
| 120 | + print " if not tag.name.startswith(\"intelligence/\")" |
| 121 | + print " and tag.name[0] == \"v\"" |
| 122 | + print " and int(tag.name[1]) > 0" |
| 123 | + print " and int(tag.name.split(\".\")[1]) >= 8" |
| 124 | + print " ]," |
| 125 | + print " key=lambda x: [int(part) for part in x[1:].split(\".\")]" |
| 126 | + print ")" |
| 127 | + print "versions.append(\"main\")" |
| 128 | + print "for version in versions:" |
| 129 | + print " html_context[\"versions\"].append({\"name\": version})" |
| 130 | + skip=1 |
| 131 | + next |
| 132 | + } |
| 133 | + # skip lines until we reach a blank line (or some other heuristic) |
| 134 | + skip && /^$/ { skip=0 } |
| 135 | + skip { next } |
| 136 | + { print } |
| 137 | + ' source/conf.py > source/conf_new.py && mv source/conf_new.py source/conf.py |
| 138 | + fi |
| 139 | + |
98 | 140 | # Copy updated version of html files |
99 | 141 | cp -r ${tmp_dir}/_templates source |
100 | 142 |
|
|
0 commit comments