#!/usr/bin/env zx $.verbose = false; try { const catOutput = await $`cat go.mod`; const contents = catOutput.stdout; const lines = contents.split("\n"); let goVersion = ""; for (let line of lines) { if (line.startsWith("go ")) { goVersion = line.substring("go ".length); break } } await $`gvm install go${goVersion}` console.log(goVersion) } catch (e) { await $`exit 0`; }