We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d79dac3 commit ac8db56Copy full SHA for ac8db56
elasticsearch-api/utils/thor/generator/files_helper.rb
@@ -44,13 +44,13 @@ def self.output_dir
44
45
def self.documentation_url(documentation_url)
46
branch = `git rev-parse --abbrev-ref HEAD`
47
- return documentation_url if branch == "main\n"
+ return documentation_url.gsub(/\/(master|main)\//, "/current/") if branch == "main\n"
48
49
regex = /([0-9]{1,2}\.[0-9x]{1,2})/
50
version = Elasticsearch::API::VERSION.match(regex)[0]
51
# TODO - How do we fix this so it doesn't depend on which branch we're running from
52
if ENV['IGNORE_VERSION']
53
- documentation_url
+ documentation_url.gsub(/\/(master|main)\//, "/current/")
54
else
55
documentation_url.gsub(/\/(current|master|main)\//, "/#{version}/")
56
end
0 commit comments