Create absolute directories for ITD to read/write

This commit is contained in:
Elara 2021-12-11 22:13:21 -08:00
parent 873df67d1f
commit 69d1027f01
2 changed files with 10 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
@ -49,7 +50,10 @@ var readCmd = &cobra.Command{
}
path = tmpFile.Name()
} else {
path = args[1]
path, err = filepath.Abs(args[1])
if err != nil {
log.Fatal().Err(err).Msg("Error making absolute directory")
}
}
client := viper.Get("client").(*api.Client)

View File

@ -22,6 +22,7 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
@ -49,7 +50,10 @@ var writeCmd = &cobra.Command{
}
path = tmpFile.Name()
} else {
path = args[0]
path, err = filepath.Abs(args[0])
if err != nil {
log.Fatal().Err(err).Msg("Error making absolute directory")
}
}
client := viper.Get("client").(*api.Client)