mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add option to change temp dir
This commit is contained in:
parent
caeb734b2c
commit
a64981930b
2 changed files with 14 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ var (
|
||||||
|
|
||||||
archiveDirectoryFlag string
|
archiveDirectoryFlag string
|
||||||
archiveOutputFlag string
|
archiveOutputFlag string
|
||||||
|
archiveTempDirFlag string
|
||||||
|
|
||||||
archiveMergeFlag string
|
archiveMergeFlag string
|
||||||
|
|
||||||
|
|
@ -146,6 +147,10 @@ func init() {
|
||||||
"\t{fps} » Frame Rate of the video\n"+
|
"\t{fps} » Frame Rate of the video\n"+
|
||||||
"\t{audio} » Audio locale of the video\n"+
|
"\t{audio} » Audio locale of the video\n"+
|
||||||
"\t{subtitle} » Subtitle locale of the video")
|
"\t{subtitle} » Subtitle locale of the video")
|
||||||
|
Cmd.Flags().StringVar(&archiveTempDirFlag,
|
||||||
|
"temp",
|
||||||
|
os.TempDir(),
|
||||||
|
"Directory to store temporary files in")
|
||||||
|
|
||||||
Cmd.Flags().StringVarP(&archiveMergeFlag,
|
Cmd.Flags().StringVarP(&archiveMergeFlag,
|
||||||
"merge",
|
"merge",
|
||||||
|
|
@ -315,6 +320,8 @@ func archiveInfo(info utils.FormatInformation, writeCloser io.WriteCloser, filen
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
tmp, _ := os.MkdirTemp(archiveTempDirFlag, "crunchy_")
|
||||||
|
downloader.TempDir = tmp
|
||||||
|
|
||||||
sig := make(chan os.Signal, 1)
|
sig := make(chan os.Signal, 1)
|
||||||
signal.Notify(sig, os.Interrupt)
|
signal.Notify(sig, os.Interrupt)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ var (
|
||||||
|
|
||||||
downloadDirectoryFlag string
|
downloadDirectoryFlag string
|
||||||
downloadOutputFlag string
|
downloadOutputFlag string
|
||||||
|
downloadTempDirFlag string
|
||||||
|
|
||||||
downloadResolutionFlag string
|
downloadResolutionFlag string
|
||||||
|
|
||||||
|
|
@ -111,6 +112,10 @@ func init() {
|
||||||
"\t{fps} » Frame Rate of the video\n"+
|
"\t{fps} » Frame Rate of the video\n"+
|
||||||
"\t{audio} » Audio locale of the video\n"+
|
"\t{audio} » Audio locale of the video\n"+
|
||||||
"\t{subtitle} » Subtitle locale of the video")
|
"\t{subtitle} » Subtitle locale of the video")
|
||||||
|
Cmd.Flags().StringVar(&downloadTempDirFlag,
|
||||||
|
"temp",
|
||||||
|
os.TempDir(),
|
||||||
|
"Directory to store temporary files in")
|
||||||
|
|
||||||
Cmd.Flags().StringVarP(&downloadResolutionFlag,
|
Cmd.Flags().StringVarP(&downloadResolutionFlag,
|
||||||
"resolution",
|
"resolution",
|
||||||
|
|
@ -230,6 +235,8 @@ func downloadInfo(info utils.FormatInformation, file *os.File) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
tmp, _ := os.MkdirTemp(downloadTempDirFlag, "crunchy_")
|
||||||
|
downloader.TempDir = tmp
|
||||||
if utils.HasFFmpeg() {
|
if utils.HasFFmpeg() {
|
||||||
downloader.FFmpegOpts = make([]string, 0)
|
downloader.FFmpegOpts = make([]string, 0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue