-
Notifications
You must be signed in to change notification settings - Fork 12
Fix go build commands #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| dist | ||
|
|
||
| # lets binary | ||
| lets | ||
| /lets | ||
| lets-dev | ||
| .lets | ||
| lets.my.yaml | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Launch Package", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${fileDirname}" | ||
| }, | ||
| { | ||
| "name": "Run", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${workspaceRoot}", | ||
| "args": [] | ||
| } | ||
| ] | ||
| } | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Launch Package", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${fileDirname}" | ||
| }, | ||
| { | ||
| "name": "Run", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${workspaceRoot}/cmd/lets/main.go", | ||
| "args": [] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -109,9 +109,9 @@ commands: | |||||
| PATH2LETSDEV=$LETSOPT_PATH | ||||||
| fi | ||||||
|
|
||||||
| go build -ldflags="-X main.version=${VERSION:1}-dev" -o "${BIN}" *.go && \ | ||||||
| go build -ldflags="-X main.Version=${VERSION:1}-dev" -o "${BIN}" ./cmd/lets && \ | ||||||
| sudo mv ./${BIN} $PATH2LETSDEV/${BIN} && \ | ||||||
| echo " - binary ${BIN} version ${VERSION} successfully installed in ${PATH2LETSDEV}" | ||||||
| echo " - binary ${BIN} version $($PATH2LETSDEV/${BIN} --version) successfully installed in ${PATH2LETSDEV}" | ||||||
|
|
||||||
| build: | ||||||
| description: Build lets from source code | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Building a file path instead of a package path Same concern as in
Suggested change
|
||||||
|
|
@@ -120,9 +120,18 @@ commands: | |||||
| cmd: | | ||||||
| VERSION=$(git describe) | ||||||
| BIN=${LETSOPT_BIN:-lets} | ||||||
|
|
||||||
| go build -ldflags="-X main.version=${VERSION:1}-dev" -o ${BIN} *.go && \ | ||||||
| echo " - binary './${BIN}' (version ${VERSION}) successfully build" | ||||||
|
|
||||||
| go build \ | ||||||
| -ldflags="-X main.Version=${VERSION:1}-dev" \ | ||||||
| -o ${BIN} ./cmd/lets | ||||||
|
|
||||||
| success=$? | ||||||
| if [[ $success -eq 0 ]]; then | ||||||
| version=$(./${BIN} --version) | ||||||
| echo " - binary './${BIN}' ($version) successfully build" | ||||||
| else | ||||||
| echo "Failed to build" | ||||||
| fi | ||||||
|
|
||||||
| publish-docs: | ||||||
| work_dir: docs | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (bug_risk): Unquoted paths in the version check could break if
PATH2LETSDEVcontains spaces.The unquoted
$PATH2LETSDEV/${BIN} --versioninvocation will break when the install path has spaces or special characters. Please quote the command, e.g.:and apply similar quoting anywhere
${BIN}or${PATH2LETSDEV}are used in commands.