Skip to content

Commit 2add1c4

Browse files
committed
add taskfile
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
1 parent f5cc770 commit 2add1c4

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

src/pkg/cli/Taskfile.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://taskfile.dev
2+
3+
version: "3"
4+
5+
silent: true
6+
7+
tasks:
8+
build:
9+
cmds:
10+
- go build -o out/d8v cmd/main.go
11+
install:
12+
deps: [build]
13+
cmds:
14+
- echo "Check that ~/.local/bin in your PATH"
15+
- echo "Installing d8v to ~/.local/bin"
16+
- mkdir -p ~/.local/bin
17+
- cp out/d8v ~/.local/bin/d8v
18+
clean:
19+
cmds:
20+
- rm -rf out

src/pkg/cli/cmd/main.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2024 Flant JSC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package main
218

319
import (
@@ -7,8 +23,7 @@ import (
723
)
824

925
func main() {
10-
programName := "d8"
11-
virtCmd, _ := command.NewCommand(programName)
26+
virtCmd, _ := command.NewCommand(os.Args[0])
1227
if err := virtCmd.Execute(); err != nil {
1328
os.Exit(1)
1429
}

0 commit comments

Comments
 (0)