Skip to content

Commit

Permalink
use third-party spinner library
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry committed Oct 18, 2023
1 parent a79c36c commit 82a2521
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 481 deletions.
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ require (
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/sync v0.3.0
golang.org/x/sys v0.9.0
golang.org/x/sys v0.13.0
golang.org/x/text v0.9.0
golang.org/x/time v0.3.0
golang.org/x/tools v0.7.0
Expand Down Expand Up @@ -119,7 +119,8 @@ require (
github.com/markbates/pkger v0.17.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/iochan v1.0.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
Expand All @@ -132,8 +133,9 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/schollz/progressbar/v3 v3.13.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -150,7 +152,7 @@ require (
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/term v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc/examples v0.0.0-20220304170021-431ea809a767 // indirect
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7 h1:oohm9Rk9JAxxmp2NLZa7Kebgz9h4+AJDcc64txg3dQ0=
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
github.com/karrick/godirwalk v1.15.6/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
Expand Down Expand Up @@ -1321,6 +1322,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
Expand All @@ -1343,6 +1346,8 @@ github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
Expand Down Expand Up @@ -1571,6 +1576,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand All @@ -1593,6 +1600,8 @@ github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2
github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis=
github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/schollz/progressbar/v3 v3.13.1 h1:o8rySDYiQ59Mwzy2FELeHY5ZARXZTVJC7iHD6PEFUiE=
github.com/schollz/progressbar/v3 v3.13.1/go.mod h1:xvrbki8kfT1fzWzBT/UZd9L6GA+jdL7HAgq2RFnO6fQ=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
Expand Down Expand Up @@ -2242,6 +2251,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -2258,6 +2269,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
51 changes: 23 additions & 28 deletions internal/pkg/agent/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ would like the Agent to operate.
func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error {
err := validateEnrollFlags(cmd)
if err != nil {
return err
return fmt.Errorf("could not validate flags: %w", err)
}

basePath, _ := cmd.Flags().GetString(flagInstallBasePath)
Expand Down Expand Up @@ -90,7 +90,7 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error {
if errors.Is(err, filelock.ErrAppAlreadyRunning) {
return fmt.Errorf("cannot perform installation as Elastic Agent is already running from this directory")
}
return err
return fmt.Errorf("error obtaining lock: %w", err)
}
_ = locker.Unlock()

Expand Down Expand Up @@ -173,53 +173,45 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error {
}
}

pt := install.NewProgressTracker(streams.Out)
s := pt.Start()
defer func() {
if err != nil {
s.Failed()
} else {
s.Succeeded()
}
}()
progBar := install.CreateAndStartNewSpinner(streams.Out)

cfgFile := paths.ConfigFile()
if status != install.PackageInstall {
err = install.Install(cfgFile, topPath, s)
err = install.Install(cfgFile, topPath, progBar)
if err != nil {
return err
return fmt.Errorf("error installing package: %w", err)
}

defer func() {
if err != nil {
uninstallStep := s.StepStart("Uninstalling")
innerErr := install.Uninstall(cfgFile, topPath, "", uninstallStep)
progBar.Describe("Uninstalling")
innerErr := install.Uninstall(cfgFile, topPath, "", progBar)
if innerErr != nil {
uninstallStep.Failed()
progBar.Describe("Failed to Uninstall")
} else {
uninstallStep.Succeeded()
progBar.Describe("Uninstalled")
}
}
}()

if !delayEnroll {
startServiceStep := s.StepStart("Starting service")
progBar.Describe("Starting Service")
err = install.StartService(topPath)
if err != nil {
startServiceStep.Failed()
progBar.Describe("Start Service failed, exiting...")
fmt.Fprintf(streams.Out, "Installation failed to start Elastic Agent service.\n")
return err
return fmt.Errorf("error starting service: %w", err)
}
startServiceStep.Succeeded()
progBar.Describe("Service Started")

defer func() {
if err != nil {
stoppingServiceStep := s.StepStart("Stopping service")
progBar.Describe("Stopping Service")
innerErr := install.StopService(topPath)
if innerErr != nil {
stoppingServiceStep.Failed()
progBar.Describe("Failed to Stop Service")
} else {
stoppingServiceStep.Succeeded()
progBar.Describe("Successfully Stopped Service")
}
}
}()
Expand All @@ -234,26 +226,29 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error {
enrollCmd.Stdout = os.Stdout
enrollCmd.Stderr = os.Stderr

enrollStep := s.StepStart("Enrolling Elastic Agent with Fleet")
progBar.Describe("Enrolling Elastic Agent with Fleet")
err = enrollCmd.Start()
if err != nil {
enrollStep.Failed()
progBar.Describe("Failed to Enroll")
return fmt.Errorf("failed to execute enroll command: %w", err)
}
progBar.Describe("Waiting For Enroll...")
err = enrollCmd.Wait()
if err != nil {
enrollStep.Failed()
progBar.Describe("Failed to Enroll")
// uninstall doesn't need to be performed here the defer above will
// catch the error and perform the uninstall
return fmt.Errorf("enroll command failed for unknown reason: %w", err)
}
enrollStep.Succeeded()
progBar.Describe("Enroll Completed")
}

if err := info.CreateInstallMarker(topPath); err != nil {
return fmt.Errorf("failed to create install marker: %w", err)
}

progBar.Finish()

Check failure on line 250 in internal/pkg/agent/cmd/install.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `progBar.Finish` is not checked (errcheck)
progBar.Exit()

Check failure on line 251 in internal/pkg/agent/cmd/install.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `progBar.Exit` is not checked (errcheck)
fmt.Fprint(streams.Out, "Elastic Agent has been successfully installed.\n")
return nil
}
13 changes: 7 additions & 6 deletions internal/pkg/agent/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,17 @@ func uninstallCmd(streams *cli.IOStreams, cmd *cobra.Command) error {
}
}

pt := install.NewProgressTracker(streams.Out)
s := pt.Start()
progBar := install.CreateAndStartNewSpinner(streams.Out)

err = install.Uninstall(paths.ConfigFile(), paths.Top(), uninstallToken, s)
err = install.Uninstall(paths.ConfigFile(), paths.Top(), uninstallToken, progBar)
if err != nil {
s.Failed()
return err
progBar.Describe("Failed to uninstall agent")
return fmt.Errorf("error uninstalling agent: %w", err)
} else {
s.Succeeded()
progBar.Describe("Done")
}
progBar.Finish()

Check failure on line 92 in internal/pkg/agent/cmd/uninstall.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `progBar.Finish` is not checked (errcheck)
progBar.Exit()

Check failure on line 93 in internal/pkg/agent/cmd/uninstall.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `progBar.Exit` is not checked (errcheck)
fmt.Fprintf(streams.Out, "Elastic Agent has been uninstalled.\n")

_ = install.RemovePath(paths.Top())
Expand Down
41 changes: 21 additions & 20 deletions internal/pkg/agent/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/jaypipes/ghw"
"github.com/otiai10/copy"
"github.com/schollz/progressbar/v3"

"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
"github.com/elastic/elastic-agent/internal/pkg/agent/errors"
Expand All @@ -23,7 +24,7 @@ const (
)

// Install installs Elastic Agent persistently on the system including creating and starting its service.
func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
func Install(cfgFile, topPath string, pt *progressbar.ProgressBar) error {
dir, err := findDirectory()
if err != nil {
return errors.New(err, "failed to discover the source directory for installation", errors.TypeFilesystem)
Expand All @@ -37,16 +38,16 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
// There is no uninstall token for "install" command.
// Uninstall will fail on protected agent.
// The protected Agent will need to be uninstalled first before it can be installed.
s := pt.StepStart("Uninstalling current Elastic Agent")
err = Uninstall(cfgFile, topPath, "", s)
pt.Describe("Uninstalling current Elastic Agent")
err = Uninstall(cfgFile, topPath, "", pt)
if err != nil {
s.Failed()
pt.Describe("Failed to uninstall current Elastic Agent")
return errors.New(
err,
fmt.Sprintf("failed to uninstall Agent at (%s)", filepath.Dir(topPath)),
errors.M("directory", filepath.Dir(topPath)))
}
s.Succeeded()
pt.Describe("Successfully uninstalled current Elastic Agent")
}

// ensure parent directory exists
Expand All @@ -68,7 +69,7 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
if HasAllSSDs(*block) {
copyConcurrency = runtime.NumCPU() * 4
}
s := pt.StepStart("Copying files")
pt.Describe("Copying install files")
err = copy.Copy(dir, topPath, copy.Options{
OnSymlink: func(_ string) copy.SymlinkAction {
return copy.Shallow
Expand All @@ -77,13 +78,13 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
NumOfWorkers: int64(copyConcurrency),
})
if err != nil {
s.Failed()
pt.Describe("Error copying files")
return errors.New(
err,
fmt.Sprintf("failed to copy source directory (%s) to destination (%s)", dir, topPath),
errors.M("source", dir), errors.M("destination", topPath))
}
s.Succeeded()
pt.Describe("Successfully copied files")

// place shell wrapper, if present on platform
if paths.ShellWrapperPath != "" {
Expand Down Expand Up @@ -134,7 +135,7 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
// post install (per platform)
err = postInstall(topPath)
if err != nil {
return err
return fmt.Errorf("error running post-install steps: %w", err)
}

// fix permissions
Expand All @@ -147,21 +148,21 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
}

// install service
s = pt.StepStart("Installing service")
pt.Describe("Installing service")
svc, err := newService(topPath)
if err != nil {
s.Failed()
return err
pt.Describe("Failed to install service")
return fmt.Errorf("error installing new service: %w", err)
}
err = svc.Install()
if err != nil {
s.Failed()
pt.Describe("Failed to install service")
return errors.New(
err,
fmt.Sprintf("failed to install service (%s)", paths.ServiceName),
errors.M("service", paths.ServiceName))
}
s.Succeeded()
pt.Describe("Installed service")

return nil
}
Expand All @@ -172,7 +173,7 @@ func Install(cfgFile, topPath string, pt ProgressTrackerStep) error {
func StartService(topPath string) error {
svc, err := newService(topPath)
if err != nil {
return err
return fmt.Errorf("error creating new service handler: %w", err)
}
err = svc.Start()
if err != nil {
Expand All @@ -188,7 +189,7 @@ func StartService(topPath string) error {
func StopService(topPath string) error {
svc, err := newService(topPath)
if err != nil {
return err
return fmt.Errorf("error creating new service handler: %w", err)
}
err = svc.Stop()
if err != nil {
Expand All @@ -204,7 +205,7 @@ func StopService(topPath string) error {
func RestartService(topPath string) error {
svc, err := newService(topPath)
if err != nil {
return err
return fmt.Errorf("error creating new service handler: %w", err)
}
err = svc.Restart()
if err != nil {
Expand All @@ -227,16 +228,16 @@ func FixPermissions(topPath string) error {
func findDirectory() (string, error) {
execPath, err := os.Executable()
if err != nil {
return "", err
return "", fmt.Errorf("error fetching executable of current process: %w", err)
}
execPath, err = filepath.Abs(execPath)
if err != nil {
return "", err
return "", fmt.Errorf("error fetching absolute file path: %w", err)
}
sourceDir := paths.ExecDir(filepath.Dir(execPath))
err = verifyDirectory(sourceDir)
if err != nil {
return "", err
return "", fmt.Errorf("error verifying directory: %w", err)
}
return sourceDir, nil
}
Expand Down
Loading

0 comments on commit 82a2521

Please sign in to comment.