File tree Expand file tree Collapse file tree 8 files changed +44
-44
lines changed Expand file tree Collapse file tree 8 files changed +44
-44
lines changed Original file line number Diff line number Diff line change 11Version := $(shell git describe --tags --dirty)
22GitCommit := $(shell git rev-parse HEAD)
3- LDFLAGS := "-s -w -X awssh/internal/cli .Version=$(Version ) -X awssh/internal/cli .GitCommit=$(GitCommit ) "
3+ LDFLAGS := "-s -w -X awssh/cmd .Version=$(Version ) -X awssh/cmd .GitCommit=$(GitCommit ) "
44OUTDIR := bin
55
66.PHONY : test pretty mod tidy
@@ -17,13 +17,13 @@ pretty:
1717 gofmt -s -w ** /* .go
1818
1919build :
20- CGO_ENABLED=0 go build -ldflags $(LDFLAGS ) -o awssh app/cli/main.go
20+ CGO_ENABLED=0 go build -ldflags $(LDFLAGS ) -o awssh
2121
2222.PHONY : dist
2323dist :
2424 mkdir -p $(OUTDIR )
25- CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh app/cli/main.go
26- CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-darwin app/cli/main.go
27- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-armhf app/cli/main.go
28- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-arm64 app/cli/main.go
29- CGO_ENABLED=0 GOOS=windows go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh.exe app/cli/main.go
25+ CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh
26+ CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-darwin
27+ CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-armhf
28+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh-arm64
29+ CGO_ENABLED=0 GOOS=windows go build -ldflags $(LDFLAGS ) -o $(OUTDIR ) /awssh.exe
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- package cli
1+ package cmd
22
33import (
4- "awssh/config"
5- "awssh/internal/aws"
6- "awssh/internal/logging"
7-
84 "fmt"
95 "regexp"
106 "strings"
117
128 "github.com/manifoldco/promptui"
139 "github.com/spf13/cobra"
10+
11+ "awssh/config"
12+ "awssh/internal/aws"
13+ "awssh/internal/logging"
1414)
1515
1616var (
Original file line number Diff line number Diff line change 1- package cli
1+ package cmd
22
33import (
44 "fmt"
Original file line number Diff line number Diff line change 11package aws
22
33import (
4- "awssh/internal/logging"
5-
64 "fmt"
75 "strings"
86
97 "github.com/aws/aws-sdk-go/aws"
108 aws_session "github.com/aws/aws-sdk-go/aws/session"
119 "github.com/aws/aws-sdk-go/service/ec2"
10+
11+ "awssh/internal/logging"
1212)
1313
1414// NewSession creates a new AWS session from region input or region environment variables (ex: AWS_DEFAULT_REGION, AWS_REGION)
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ import (
66 "os/exec"
77 "strings"
88
9- "awssh/config"
10- "awssh/internal/logging"
11- "awssh/internal/ssh"
12-
139 "github.com/aws/aws-sdk-go/aws"
1410 "github.com/aws/aws-sdk-go/aws/awserr"
1511 aws_session "github.com/aws/aws-sdk-go/aws/session"
1612 "github.com/aws/aws-sdk-go/service/ec2"
1713 "github.com/aws/aws-sdk-go/service/ec2instanceconnect"
14+
15+ "awssh/config"
16+ "awssh/internal/logging"
17+ "awssh/internal/ssh"
1818)
1919
2020// EC2Instance represent all the necessary EC2 components
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import (
55 "net"
66 "os"
77
8- "awssh/config"
9- "awssh/internal/logging"
10-
118 gossh "golang.org/x/crypto/ssh"
129 "golang.org/x/crypto/ssh/agent"
10+
11+ "awssh/config"
12+ "awssh/internal/logging"
1313)
1414
1515// Session represent an SSH data model consist of a SSH PublicKey
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "os"
5+
6+ "awssh/cmd"
7+ "awssh/config"
8+ )
9+
10+ func main () {
11+
12+ config .Load ()
13+
14+ rootCmd := cmd .MakeRoot ()
15+ versionCmd := cmd .MakeVersion ()
16+
17+ rootCmd .AddCommand (versionCmd )
18+
19+ if err := rootCmd .Execute (); err != nil {
20+ os .Exit (1 )
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments