forked from Elara6331/itd
Create absolute directories for ITD to read/write
This commit is contained in:
parent
873df67d1f
commit
69d1027f01
@ -22,6 +22,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -49,7 +50,10 @@ var readCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
path = tmpFile.Name()
|
path = tmpFile.Name()
|
||||||
} else {
|
} 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)
|
client := viper.Get("client").(*api.Client)
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -49,7 +50,10 @@ var writeCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
path = tmpFile.Name()
|
path = tmpFile.Name()
|
||||||
} else {
|
} 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)
|
client := viper.Get("client").(*api.Client)
|
||||||
|
Loading…
Reference in New Issue
Block a user