mirror of
https://github.com/Adembc/lazyssh.git
synced 2026-07-14 12:13:34 +02:00
minimal ssh
This commit is contained in:
+24
-4
@@ -17,9 +17,13 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/Adembc/lazyssh/internal/adapters/data/memory"
|
||||
"github.com/Adembc/lazyssh/internal/adapters/data/file"
|
||||
|
||||
"github.com/Adembc/lazyssh/internal/logger"
|
||||
|
||||
"github.com/Adembc/lazyssh/internal/adapters/ui"
|
||||
"github.com/Adembc/lazyssh/internal/core/services"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -32,9 +36,25 @@ var (
|
||||
)
|
||||
|
||||
func main() {
|
||||
serverInMemoryRepo := memory.NewServerRepository()
|
||||
serverService := services.NewServerService(serverInMemoryRepo)
|
||||
tui := ui.NewTUI(serverService, version, gitCommit, buildTime)
|
||||
log, err := logger.New("LAZYSSH")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer log.Sync()
|
||||
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Errorw("failed to get user home directory", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
sshConfigFile := filepath.Join(home, ".ssh", "config")
|
||||
metaDataFile := filepath.Join(home, ".lazyssh", "metadata.json")
|
||||
|
||||
serverRepo := file.NewServerRepo(log, sshConfigFile, metaDataFile)
|
||||
// serverInMemoryRepo := memory.NewServerRepository(log)
|
||||
serverService := services.NewServerService(log, serverRepo)
|
||||
tui := ui.NewTUI(log, serverService, version, gitCommit, buildTime)
|
||||
|
||||
rootCmd := &cobra.Command{
|
||||
Use: ui.AppName,
|
||||
|
||||
Reference in New Issue
Block a user