Skip to content

Commit d980dca

Browse files
authored
Merge pull request #27 from dewep-online/develop
update vendors + fix add folder to deb package
2 parents b4ee15f + 60df13a commit d980dca

25 files changed

+140
-147
lines changed

.deb.yaml

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
package: deb-builder
22
source: deb-builder
3-
version: '1:0.4.0'
3+
version: '1:0.4.1'
44
architecture:
5-
- 386
65
- amd64
7-
- arm
86
- arm64
97
maintainer: DewepOnline <[email protected]>
10-
homepage: https://dewep.online/deb-builder.html
8+
homepage: https://dewep.online/deb-builder
119
description:
1210
- Debian package builder
1311
section: web
1412
priority: optional
1513
control:
16-
depends:
17-
- systemd
18-
- ca-certificates
19-
build: scripts/build.sh
20-
preinst: scripts/preinst.sh
21-
postinst: scripts/postinst.sh
22-
prerm: scripts/prerm.sh
23-
postrm: scripts/postrm.sh
14+
build: devtool build --arch=%arch%
2415
data:
25-
usr/bin/deb-builder: build/bin/deb-builder_%arch%
16+
usr/bin/deb-builder: build/deb-builder_%arch%

.github/workflows/ci.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [ master ]
66
pull_request:
7-
branches: [master]
7+
branches: [ master ]
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
go: [ '1.17', '1.18', '1.19' ]
1215
steps:
13-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1417

15-
- name: Set up Go
16-
uses: actions/setup-go@v2
18+
- name: Setup Go
19+
uses: actions/setup-go@v3
1720
with:
18-
go-version: 1.16
21+
go-version: ${{ matrix.go }}
1922

20-
- name: CI
23+
- name: Run CI
2124
env:
2225
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
23-
run: make ci
26+
run: make ci

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ vendorgo test -c`
1515
*.test
1616
*.out
1717
vendor/
18-
build/bin
18+
build/

Makefile

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
SHELL=/bin/bash
2-
GOPATH=$(shell go env GOPATH)
31

4-
.PHONY: new-conf
5-
new-conf:
6-
go run -race cmd/deb-builder/main.go new-conf
2+
.PHONY: install
3+
install:
4+
go install github.com/dewep-online/devtool@latest
5+
6+
.PHONY: setup
7+
setup:
8+
devtool setup-lib
9+
10+
.PHONY: lint
11+
lint:
12+
devtool lint
713

814
.PHONY: build
915
build:
10-
bash scripts/build.sh amd64
11-
12-
.PHONY: linter
13-
linter:
14-
bash scripts/linter.sh
16+
devtool build --arch=amd64
1517

1618
.PHONY: tests
1719
tests:
18-
bash scripts/tests.sh
20+
devtool test
21+
22+
.PHONY: pre-commite
23+
pre-commite: setup lint build tests
1924

2025
.PHONY: ci
21-
ci:
22-
bash scripts/ci.sh
26+
ci: install setup lint build tests
2327

2428
deb:
2529
deb-builder build
2630

27-
install: build
28-
cp ./build/bin/deb-builder_amd64 $(GOPATH)/bin/deb-builder
31+
local: build
32+
cp ./build/deb-builder_amd64 $(GOPATH)/bin/deb-builder

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ control:
4040
depends: # This declares an absolute dependency. A package will not be configured unless all of the packages listed in its Depends field have been correctly configured (unless there is a circular dependency as described above).
4141
- systemd | supervisor
4242
- ca-certificates
43-
build: scripts/build.sh # This field defines the script for building the application from the source code. During the build, the name of the architecture is passed to the script. Example: sh scripts/build.sh amd64
43+
build: scripts/build.sh %arch% # This field defines the script for building the application from the source code. During the build, the name of the architecture is passed to the script. Example: sh scripts/build.sh amd64
4444
conffiles: # The list of package files that are configuration files, when updating, files from this list are not overwritten with new ones, unless this is specified separately;
4545
- /etc/demo/config.yaml
4646
preinst: scripts/preinst.sh # The script executed before installation.

build/README.md

-8
This file was deleted.

cmd/deb-builder/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"github.com/dewep-online/deb-builder/internal/commands"
55

6-
"github.com/deweppro/go-app/console"
6+
"github.com/deweppro/go-sdk/console"
77
)
88

99
func main() {

go.mod

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
module github.com/dewep-online/deb-builder
22

3-
go 1.19
3+
go 1.17
44

55
require (
6-
github.com/deweppro/go-app v1.6.3
76
github.com/deweppro/go-archives v1.0.4
87
github.com/deweppro/go-errors v0.0.4
9-
github.com/stretchr/testify v1.8.1
10-
golang.org/x/crypto v0.4.0
8+
github.com/deweppro/go-sdk v1.1.6
9+
github.com/stretchr/testify v1.8.2
10+
golang.org/x/crypto v0.7.0
1111
gopkg.in/yaml.v3 v3.0.1
1212
)
1313

1414
require (
1515
github.com/davecgh/go-spew v1.1.1 // indirect
16-
github.com/deweppro/go-algorithms v1.2.0 // indirect
17-
github.com/deweppro/go-chan-pool v1.1.2 // indirect
18-
github.com/deweppro/go-logger v1.3.0 // indirect
19-
github.com/deweppro/go-utils v0.0.1 // indirect
16+
github.com/deweppro/go-algorithms v1.2.1 // indirect
2017
github.com/josharian/intern v1.0.0 // indirect
2118
github.com/mailru/easyjson v0.7.7 // indirect
2219
github.com/pmezard/go-difflib v1.0.0 // indirect

go.sum

+60-13
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,84 @@
1+
cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
12
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
23
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
34
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4-
github.com/deweppro/go-algorithms v1.2.0 h1:fBS+GNQaeSDSmvFWdmkKLcKXo2DhX5M0AJaCxEqGedY=
5-
github.com/deweppro/go-algorithms v1.2.0/go.mod h1:zYdfRdlpaXgdT36OgvdjH1qtTZFWEeBi3KUQmWltMPI=
6-
github.com/deweppro/go-app v1.6.3 h1:IZr8Zyq+RtpOQDZxUIRCTCppN9w3c/xG+9YUX+ECPnA=
7-
github.com/deweppro/go-app v1.6.3/go.mod h1:1Zj2Mfj/vPXe3PfrWQ5MAM9l2TSVLbp5i6OCyKD4mO4=
5+
github.com/deweppro/go-algorithms v1.2.1 h1:5/IEqw7WOaGsaaBSP1hIq16has91MV6Te0SNwCwSK+E=
6+
github.com/deweppro/go-algorithms v1.2.1/go.mod h1:VW0wmlJiXEw+TVEAtWDr+P7Zg9IocCmkS8VSIDoDHlc=
87
github.com/deweppro/go-archives v1.0.4 h1:CB5nX5ll7PyDU5s5yFmBq9Dn5xZGjSRumawZRZgMfkk=
98
github.com/deweppro/go-archives v1.0.4/go.mod h1:3OVhSu087B6aIsFGBzEMCE6iZzBC39bI/MB4qAOlQVI=
10-
github.com/deweppro/go-chan-pool v1.1.2 h1:mm+gvwAFB5NijCiJDSx9RqrB2AWTembzL9Rf6XTv4BI=
11-
github.com/deweppro/go-chan-pool v1.1.2/go.mod h1:6meJsORhraeyvJNPy4hx8xgBNjp2xx3KGB/d5Q5a/I4=
129
github.com/deweppro/go-errors v0.0.4 h1:TW91LRqHAkUauDJ5lzz73LziANH7mjli1tyvtwzXRCM=
1310
github.com/deweppro/go-errors v0.0.4/go.mod h1:BLsNcxaHh1fjNl/o1TB69JwA8XueSk/Nszkvw4ZwI/I=
14-
github.com/deweppro/go-logger v1.3.0 h1:KN6RQmb6IoNBxQ7zx7Y1AtptHeL//FRgvQyEF5PrcsE=
15-
github.com/deweppro/go-logger v1.3.0/go.mod h1:jxBBLyHmIvJ4erGUj5qeE6ir36ztyAL1pI+9GymOHVI=
16-
github.com/deweppro/go-utils v0.0.1 h1:yBISU0cvDqj2MjJGf/WXMft76zGT7ETCHJST52pYkSw=
17-
github.com/deweppro/go-utils v0.0.1/go.mod h1:wH2zpJsk1kc1MOALmxxfZaVomKkRX9K6U1m5Rs2VvHA=
11+
github.com/deweppro/go-sdk v1.1.6 h1:yjCsPMc02fGw2nZ/0grorPovTu1J6Njrz8L821QuSiA=
12+
github.com/deweppro/go-sdk v1.1.6/go.mod h1:orW509URVLItj8Xah+PwcEyjwVi7L3lTbVfEeg1T8/c=
13+
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
14+
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
15+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
16+
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
17+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
18+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1819
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
1920
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
2021
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
2122
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
23+
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
2224
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2325
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2426
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2527
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
2628
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
29+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2730
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2831
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
29-
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
3032
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
31-
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
32-
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
33+
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
34+
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
35+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
36+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
37+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
38+
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
39+
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
40+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
41+
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
42+
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
43+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
44+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
45+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
46+
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
47+
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
48+
golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
49+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
50+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
51+
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
52+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
53+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
54+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
55+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
56+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
57+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
58+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
59+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
60+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
61+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
62+
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
63+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
64+
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
65+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
66+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
67+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
68+
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
69+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
70+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
71+
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
72+
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
73+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
74+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
75+
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
76+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
77+
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
78+
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
3379
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
3480
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3581
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
82+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3683
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
3784
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/commands/build.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/dewep-online/deb-builder/pkg/exec"
1414
"github.com/dewep-online/deb-builder/pkg/packages"
1515
"github.com/dewep-online/deb-builder/pkg/utils"
16-
"github.com/deweppro/go-app/console"
1716
"github.com/deweppro/go-archives/ar"
17+
"github.com/deweppro/go-sdk/console"
1818
)
1919

2020
func Build() console.CommandGetter {
@@ -37,12 +37,7 @@ func Build() console.CommandGetter {
3737
storeDir := fmt.Sprintf("%s/%s/%s", baseDir, conf.Package[0:1], conf.Package)
3838
console.FatalIfErr(os.MkdirAll(storeDir, 0755), "creating storage directory")
3939

40-
exec.Build(conf, func(arch string) {
41-
42-
replacer := strings.NewReplacer(
43-
`%arch%`, arch,
44-
`%version%`, packages.SplitVersion(conf.Version),
45-
)
40+
exec.Build(conf, func(arch string, replacer exec.Replacer) {
4641

4742
// check file version
4843

@@ -70,24 +65,31 @@ func Build() console.CommandGetter {
7065
f, h, err1 = tg.WriteData(dst, []byte(src)[1:])
7166
console.FatalIfErr(err1, "write %s to data.tar.gz", src)
7267
md5sum.Add(f, h)
68+
console.Infof("Add: %s", dst)
7369
case '~':
74-
err1 := filepath.Walk(src[1:], func(path string, info fs.FileInfo, e error) error {
70+
fullpath, err0 := filepath.Abs(src[1:])
71+
console.FatalIfErr(err0, "get full path for %s", src[1:])
72+
73+
err2 := filepath.Walk(fullpath, func(path string, info fs.FileInfo, e error) error {
7574
if e != nil {
7675
return e
7776
}
7877
if info.IsDir() {
7978
return nil
8079
}
81-
ff, hh, ee := tg.WriteFile(path, strings.ReplaceAll(path, src[1:], dst))
80+
walkedFile := strings.ReplaceAll(path, fullpath, dst)
81+
ff, hh, ee := tg.WriteFile(path, walkedFile)
8282
console.FatalIfErr(ee, "write %s to data.tar.gz", src)
8383
md5sum.Add(ff, hh)
84+
console.Infof("Add: %s", walkedFile)
8485
return nil
8586
})
86-
console.FatalIfErr(err1, "write %s to data.tar.gz", src)
87+
console.FatalIfErr(err2, "write %s to data.tar.gz", src)
8788
default:
8889
f, h, err1 = tg.WriteFile(src, dst)
8990
console.FatalIfErr(err1, "write %s to data.tar.gz", src)
9091
md5sum.Add(f, h)
92+
console.Infof("Add: %s", dst)
9193
}
9294
}
9395
console.FatalIfErr(tg.Close(), "close data.tar.gz")

internal/commands/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package commands
22

33
import (
44
"github.com/dewep-online/deb-builder/pkg/config"
5-
"github.com/deweppro/go-app/console"
5+
"github.com/deweppro/go-sdk/console"
66
)
77

88
func CreateConfig() console.CommandGetter {

internal/commands/pgp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"os"
55

66
"github.com/dewep-online/deb-builder/pkg/pgp"
7-
"github.com/deweppro/go-app/console"
7+
"github.com/deweppro/go-sdk/console"
88
)
99

1010
func CreatePGPCert() console.CommandGetter {

internal/commands/release.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/deweppro/go-archives/ar"
1919

2020
"github.com/dewep-online/deb-builder/pkg/pgp"
21-
"github.com/deweppro/go-app/console"
21+
"github.com/deweppro/go-sdk/console"
2222
)
2323

2424
const (

pkg/buffer/buffer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package buffer
33
import (
44
"bytes"
55

6-
"github.com/deweppro/go-app/console"
6+
"github.com/deweppro/go-sdk/console"
77
)
88

99
type Buffer struct {

pkg/di.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package pkg
22

3-
import "github.com/deweppro/go-app/application"
3+
import (
4+
"github.com/deweppro/go-sdk/app"
5+
)
46

57
var (
68
//Module di injector
7-
Module = application.Modules{}
9+
Module = app.Modules{}
810
//Config di injector
9-
Config = application.Modules{}
11+
Config = app.Modules{}
1012
)

0 commit comments

Comments
 (0)