44local state = require (" gitlab.state" )
55local u = require (" gitlab.utils" )
66local job = require (" gitlab.job" )
7+ local version = require (" gitlab.version" )
78local M = {}
89
910-- Builds the binary if it doesn't exist, and starts the server. If the pre-existing binary has an older
@@ -23,8 +24,8 @@ M.build_and_start = function(callback)
2324 callback ()
2425 return
2526 end
26- M .get_version (function (version )
27- if version .plugin_version ~= version .binary_version then
27+ M .get_version (function (versions )
28+ if versions .plugin_version ~= versions .binary_version then
2829 M .shutdown (function ()
2930 if M .build (true ) then
3031 M .start (callback )
@@ -116,6 +117,12 @@ M.build = function(override)
116117 return
117118 end
118119
120+ local version_issue = version .check_go_version ()
121+ if version_issue ~= nil then
122+ u .notify (version_issue , vim .log .levels .ERROR )
123+ return
124+ end
125+
119126 -- If the user did not provide a path, we build it and place it in either the data path, or the
120127 -- first writable path we find in the runtime.
121128 local datapath = vim .fn .stdpath (" data" )
@@ -150,9 +157,9 @@ M.build = function(override)
150157 local version_output = vim
151158 .system ({ " git" , " describe" , " --tags" , " --always" }, { cwd = state .settings .root_path })
152159 :wait ()
153- local version = version_output .code == 0 and vim .trim (version_output .stdout ) or " unknown"
160+ local plugin_version = version_output .code == 0 and vim .trim (version_output .stdout ) or " unknown"
154161
155- local ldflags = string.format (" -X main.Version=%s" , version )
162+ local ldflags = string.format (" -X main.Version=%s" , plugin_version )
156163 local res = vim
157164 .system (
158165 { " go" , " build" , " -buildvcs=false" , " -ldflags" , ldflags , " -o" , state .settings .server .binary },
0 commit comments