Skip to content

Commit a2917f9

Browse files
author
Lapp
committed
project: implemented
0 parents  commit a2917f9

16 files changed

+1311
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.DS_Store

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.PHONY: \
2+
build-darwin_arm64 build-darwin_amd64 build-linux_amd64 build-windows_amd64 \
3+
setup-macos_m1 setup-macos_intel setup-linux
4+
5+
.SILENT:
6+
7+
build-darwin_arm64:
8+
GOOS=darwin GOARCH=arm64 go build -o build/bin/docsel-darwin_arm64 cmd/main.go
9+
10+
build-darwin_amd64:
11+
GOOS=darwin GOARCH=amd64 go build -o build/bin/docsel-darwin_amd64 cmd/main.go
12+
13+
build-linux_amd64:
14+
GOOS=linux GOARCH=amd64 go build -o build/bin/docsel-linux_amd64 cmd/main.go
15+
16+
build-windows_amd64:
17+
GOOS=windows GOARCH=amd64 go build -o build/bin/docsel-windows_amd64.exe cmd/main.go
18+
19+
setup-macos_m1:
20+
sudo mkdir -p /usr/local/bin && sudo cp build/bin/docsel-darwin_arm64 /usr/local/bin/docsel
21+
22+
setup-macos_intel:
23+
sudo mkdir -p /usr/local/bin && sudo cp build/bin/docsel-darwin_amd64 /usr/local/bin/docsel
24+
25+
setup-linux:
26+
sudo mkdir -p /usr/local/bin && sudo cp build/bin/docsel-linux_amd64 /usr/local/bin/docsel

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Docsel
2+
[![Go](https://img.shields.io/badge/go-1.17-blue)](https://golang.org/doc/go1.17) [![Release](https://img.shields.io/badge/release-1.0.0-success)](https://github.com/Lapp-coder/docsel/releases)
3+
4+
Docsel is a utility that allows you to run the services you choose based on the docker-compose file.
5+
6+
## Example
7+
![docsel example](https://github.com/Lapp-coder/docsel/blob/resourses/docsel-example.gif)
8+
9+
## Installation
10+
1. Clone the repository
11+
```shell
12+
$ git clone https://github.com/Lapp-coder/docsel
13+
```
14+
2. Go to the directory of the utility
15+
```shell
16+
$ cd docsel
17+
```
18+
3. Follow the installation steps for your OS
19+
* MacOS on M1
20+
```shell
21+
$ chmod +x build/bin/docsel-darwin_arm64 \
22+
&& make setup-macos_m1
23+
```
24+
* MacOS on Intel
25+
```shell
26+
$ chmod +x build/bin/docsel-darwin_amd64 \
27+
&& make setup-macos_intel
28+
```
29+
30+
* Linux
31+
```shell
32+
$ chmod +x build/bin/docsel-linux_amd64 \
33+
&& make setup-linux
34+
```
35+
36+
* Windows
37+
```shell
38+
$ setup-windows.bat
39+
```

build/bin/docsel-darwin_amd64

4.85 MB
Binary file not shown.

build/bin/docsel-darwin_arm64

4.99 MB
Binary file not shown.

build/bin/docsel-linux_amd64

4.89 MB
Binary file not shown.

build/bin/docsel-windows_amd64.exe

5.34 MB
Binary file not shown.

cmd/main.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"log"
5+
6+
"github.com/Lapp-coder/docsel/internal/app"
7+
)
8+
9+
func main() {
10+
var filepath string
11+
app.RunCmd.
12+
PersistentFlags().
13+
StringVarP(&filepath, app.FlagPath, app.ShorthandFlagPath, app.DefaultFlagPathValue, app.DescFlagPath)
14+
app.RunCmd.
15+
PersistentFlags().
16+
BoolP(app.FlagDetach, app.ShorthandFlagDetach, app.DefaultFlagDetachValue, app.DescFlagDetach)
17+
app.RunCmd.
18+
PersistentFlags().
19+
Bool(app.FlagRemove, app.DefaultFlagRemoveValue, app.DescFlagRemove)
20+
app.RunCmd.
21+
PersistentFlags().
22+
BoolP(app.FlagSave, app.ShorthandFlagSave, app.DefaultFlagSaveValue, app.DescFlagSave)
23+
24+
app.RootCmd.AddCommand(app.RunCmd)
25+
if err := app.RootCmd.Execute(); err != nil {
26+
log.Fatalln(err)
27+
}
28+
}

go.mod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module github.com/Lapp-coder/docsel
2+
3+
go 1.17
4+
5+
require (
6+
github.com/eiannone/keyboard v0.0.0-20200508000154-caf4b762e807
7+
github.com/fatih/color v1.13.0
8+
github.com/spf13/cobra v1.3.0
9+
gopkg.in/yaml.v2 v2.4.0
10+
)
11+
12+
require (
13+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
14+
github.com/mattn/go-colorable v0.1.12 // indirect
15+
github.com/mattn/go-isatty v0.0.14 // indirect
16+
github.com/spf13/pflag v1.0.5 // indirect
17+
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
18+
)

go.sum

Lines changed: 769 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)