Skip to content

Commit

Permalink
Merge pull request aerokube#343 from vania-pooh/master
Browse files Browse the repository at this point in the history
Automatically creating video directory for Docker only
  • Loading branch information
vania-pooh committed Jan 30, 2018
2 parents e5648f5 + ff1e0fc commit 6ab8b2a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ func init() {
if err == nil {
inDocker = true
}
videoOutputDir, err = filepath.Abs(videoOutputDir)
if err != nil {
log.Fatalf("Invalid video output dir %s: %v", videoOutputDir, err)
}
err = os.MkdirAll(videoOutputDir, os.FileMode(0644))
if err != nil {
log.Fatalf("Failed to create video output dir %s: %v", videoOutputDir, err)

if !disableDocker {
videoOutputDir, err = filepath.Abs(videoOutputDir)
if err != nil {
log.Fatalf("Invalid video output dir %s: %v", videoOutputDir, err)
}
err = os.MkdirAll(videoOutputDir, os.FileMode(0644))
if err != nil {
log.Fatalf("Failed to create video output dir %s: %v", videoOutputDir, err)
}
}

environment := service.Environment{
InDocker: inDocker,
CPU: int64(cpu),
Expand Down

0 comments on commit 6ab8b2a

Please sign in to comment.