File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ git-semver
3
3
.testworkdir
4
4
5
5
dist /
6
+
7
+ /bin
Original file line number Diff line number Diff line change @@ -15,10 +15,19 @@ $ docker pull psanetra/git-semver
15
15
16
16
To build locally for testing, ensure you have ` go ` installed.
17
17
18
+ Run ` make build ` to generate a ` git-semver ` package at ` /bin/git-semver ` .
19
+
20
+ The make file also allows for input of filenames.
21
+
22
+ To manually build without the use of the make file:
23
+
18
24
1 . ` cd ` to the ` cli ` folder of the repo.
19
25
2 . Run ` go build -o <output_file> ` to build the package.
20
- 3 . Once complete, copy the package to a location in your terminal's path.
21
- 4 . Run ` source ~/.bashrc ` (or appropriate ` .rc ` file for your terminal) to include the new package.
26
+
27
+ Once the build is complete, follow these steps to ensure you can run the package:
28
+
29
+ 1 . Once complete, copy the package to a location in your terminal's path.
30
+ 2 . Run ` source ~/.bashrc ` (or appropriate ` .rc ` file for your terminal) to include the new package.
22
31
23
32
## Commands
24
33
Original file line number Diff line number Diff line change
1
+ # Makefile at repo root
2
+
3
+ BINARY_NAME ?= git-semver
4
+ BUILD_DIR := cli
5
+ BIN_DIR := bin
6
+
7
+ .PHONY : all build clean test
8
+
9
+ all : build
10
+
11
+ # # Build the CLI into ./bin/
12
+ build :
13
+ @echo " Building $( BINARY_NAME) from $( BUILD_DIR) ..."
14
+ @mkdir -p $(BIN_DIR )
15
+ @cd $(BUILD_DIR ) && go build -o ../$(BIN_DIR ) /$(BINARY_NAME )
16
+
17
+ # # Run all Go tests
18
+ test :
19
+ @echo " Running tests..."
20
+ @go test ./...
21
+
22
+ # # Remove build artifacts
23
+ clean :
24
+ @echo " Cleaning build artifacts..."
25
+ @rm -rf $(BIN_DIR ) /
You can’t perform that action at this time.
0 commit comments