mirror of https://github.com/databricks/cli.git
refactor: Add context import and comment for version parsing in patchwheel.go
This commit is contained in:
parent
174db9432c
commit
64e7ad779a
|
@ -4,6 +4,7 @@ import (
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"errors"
|
"errors"
|
||||||
|
@ -56,6 +57,7 @@ func parseMetadata(content []byte) (version, distribution string, err error) {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
if strings.HasPrefix(line, versionKey) {
|
if strings.HasPrefix(line, versionKey) {
|
||||||
v := strings.TrimSpace(strings.TrimPrefix(line, versionKey))
|
v := strings.TrimSpace(strings.TrimPrefix(line, versionKey))
|
||||||
|
// AI TODO: return full version here; make caller do the parsing instead.
|
||||||
// If there's a '+' in the version, strip it off.
|
// If there's a '+' in the version, strip it off.
|
||||||
v = strings.SplitN(v, "+", 2)[0]
|
v = strings.SplitN(v, "+", 2)[0]
|
||||||
version = v
|
version = v
|
||||||
|
|
Loading…
Reference in New Issue