commit 79faf3722df81219bb69846947f0f38aad568d98
parent 1bd2b82fa64f2c949bfe294cbb910f3d460bf75f
Author: Jack Mordaunt <jackmordaunt@gmail.com>
Date: Thu, 22 Nov 2018 14:55:16 +1300
[+] Accept custom path to temporary directory.
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cmd/build/main.go b/cmd/build/main.go
@@ -122,6 +122,7 @@ func main() {
"-v ",
"-ffmpeg $DIR/../Resources/ffmpeg ",
"-log $DIR/../giffer.log ",
+ "-tmp $DIR/../Resources/tmp ",
}, "")
name := filepath.Join(macos, "giffer.sh")
if err := ioutil.WriteFile(name, []byte(wrapper), 0777); err != nil {
diff --git a/cmd/desktop/main.go b/cmd/desktop/main.go
@@ -28,6 +28,7 @@ var (
verbose bool
headless bool
ffmpeg string
+ tmp string
logfile string
logf *os.File
static http.Handler // responsible for serving UI files.
@@ -40,6 +41,7 @@ func init() {
flag.BoolVar(&verbose, "v", false, "verbose mode")
flag.BoolVar(&headless, "headless", false, "headless mode; run only the server")
flag.StringVar(&ffmpeg, "ffmpeg", "", "custom path to ffmpeg binary")
+ flag.StringVar(&tmp, "tmp", "tmp", "path to store generated files")
flag.StringVar(&logfile, "log", "", "path to log file to capture stdout")
flag.Parse()
if logfile != "" {
@@ -74,18 +76,19 @@ func main() {
ui := &UI{
App: &Giffer{
Downloader: &giffer.Downloader{
- Dir: filepath.Join(filepath.Dir(ffmpeg), "tmp/downloads"),
+ Dir: filepath.Join(tmp, "downloads"),
FFmpeg: ffmpeg,
Debug: verbose,
Out: logf,
},
Engine: &giffer.Engine{
+ Dir: filepath.Join(tmp, "junk"),
FFmpeg: ffmpeg,
Debug: verbose,
Out: logf,
},
Store: &gifdb{
- Dir: filepath.Join(filepath.Dir(ffmpeg), "tmp/gifs"),
+ Dir: filepath.Join(tmp, "gifs"),
},
},
Router: mux.NewRouter(),