Skip to content

Commit ef700fc

Browse files
committed
enable to go get as cli
1 parent 95519c8 commit ef700fc

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ go_path(
88
name = "gopath",
99
mode = "link",
1010
deps = [
11-
"//content/cmd",
11+
"//content/cmd/content",
1212
],
1313
)
1414

Makefile

+4-9
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ BZL_BIN := $(shell npx bazelisk info bazel-bin)
1010
deploy/theme:
1111
$(TK) deploy --dir theme
1212

13-
deploy/contents: $(MD_FILES) bin/content
14-
./bin/content deploy \
13+
deploy/contents: $(MD_FILES)
14+
$(BZL) run //content/cmd/content -- deploy \
1515
--input $(PWD)/contents \
1616
--domain k9books.myshopify.com \
1717
--key $(MARKDOWN_APP_KEY) \
1818
--secret $(MARKDOWN_APP_SECRET) \
1919
--token $(MARKDOWN_APP_SECRET)
2020

21-
download/contents: $(MD_FILES) bin/content
22-
./bin/content download \
21+
download/contents: $(MD_FILES)
22+
$(BZL) run //content/cmd/content -- download \
2323
--output $(PWD)/contents \
2424
--domain k9books.myshopify.com \
2525
--key $(MARKDOWN_APP_KEY) \
@@ -44,11 +44,6 @@ bin/*: $(GO_FILES) WORKSPACE
4444
$(BZL) build //$(@F):all
4545
cp -f $(BZL_BIN)/$(@F)/$(@F)_/$(@F) bin/
4646

47-
bin/content: $(GO_FILES) WORKSPACE
48-
mkdir -p bin
49-
$(BZL) build //content/cmd:all
50-
cp -f $(BZL_BIN)/content/cmd/cmd_/cmd bin/content
51-
5247
.PHONY: setup
5348
setup: WORKSPACE */BUILD.bazel GOPATH
5449

content/cmd/BUILD.bazel renamed to content/cmd/content/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
33
go_library(
44
name = "go_default_library",
55
srcs = ["main.go"],
6-
importpath = "github.com/kogai/k9bookshelf/content/cmd",
6+
importpath = "github.com/kogai/k9bookshelf/content/cmd/content",
77
visibility = ["//visibility:private"],
88
deps = [
99
"//content:go_default_library",
@@ -12,7 +12,7 @@ go_library(
1212
)
1313

1414
go_binary(
15-
name = "cmd",
15+
name = "content",
1616
embed = [":go_default_library"],
1717
visibility = ["//visibility:public"],
1818
)
File renamed without changes.

0 commit comments

Comments
 (0)