Add 'environment' package
This commit adds a new environment package that manages all calls to the underlying operating system.
This commit is contained in:
parent
822c70cd69
commit
f19619ef9f
60 changed files with 539 additions and 308 deletions
|
|
@ -1,10 +1,10 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
wisski_distillery "github.com/FAU-CDI/wisski-distillery"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/core"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/fsx"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
|
||||
)
|
||||
|
||||
|
|
@ -29,13 +29,10 @@ func (monday) Description() wisski_distillery.Description {
|
|||
}
|
||||
|
||||
func (monday monday) AfterParse() error {
|
||||
_, err := os.Stat(monday.Positionals.GraphdbZip)
|
||||
if os.IsNotExist(err) {
|
||||
// TODO: Use a generic environment here!
|
||||
if !fsx.IsFile(environment.Native{}, monday.Positionals.GraphdbZip) {
|
||||
return errNoGraphDBZip.WithMessageF(monday.Positionals.GraphdbZip)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue