Manager: default paths for executables are now relative

This assumes that `blender` and `ffmpeg` are available on the commandline.
This commit is contained in:
Sybren A. Stüvel 2022-02-22 13:54:21 +01:00
parent 32c7a1fd84
commit 7d67a1dc7a
2 changed files with 9 additions and 7 deletions

View File

@ -78,22 +78,24 @@ var defaultConfig = Conf{
}, },
Variables: map[string]Variable{ Variables: map[string]Variable{
// The default commands assume that the executables are available on $PATH.
"blender": { "blender": {
Direction: "oneway", Direction: "oneway",
Values: VariableValues{ Values: VariableValues{
VariableValue{Platform: "linux", Value: "/linux/path/to/blender"}, VariableValue{Platform: "linux", Value: "blender --factory-startup --background"},
VariableValue{Platform: "windows", Value: "C:/windows/path/to/blender.exe"}, VariableValue{Platform: "windows", Value: "blender.exe --factory-startup --background"},
VariableValue{Platform: "darwin", Value: "/Volumes/Applications/Blender/blender"}, VariableValue{Platform: "darwin", Value: "blender --factory-startup --background"},
}, },
}, },
"ffmpeg": { "ffmpeg": {
Direction: "oneway", Direction: "oneway",
Values: VariableValues{ Values: VariableValues{
VariableValue{Platform: "linux", Value: "/usr/bin/ffmpeg"}, VariableValue{Platform: "linux", Value: "ffmpeg"},
VariableValue{Platform: "windows", Value: "C:/windows/path/to/ffmpeg.exe"}, VariableValue{Platform: "windows", Value: "ffmpeg.exe"},
VariableValue{Platform: "darwin", Value: "/Volumes/Applications/FFmpeg/ffmpeg"}, VariableValue{Platform: "darwin", Value: "ffmpeg"},
}, },
}, },
// TODO: determine useful defaults for these.
"job_storage": { "job_storage": {
Direction: "twoway", Direction: "twoway",
Values: VariableValues{ Values: VariableValues{

View File

@ -38,7 +38,7 @@ func TestDefaultSettings(t *testing.T) {
assert.Contains(t, config.Variables, "job_storage") assert.Contains(t, config.Variables, "job_storage")
assert.Contains(t, config.Variables, "render") assert.Contains(t, config.Variables, "render")
assert.Equal(t, "oneway", config.Variables["ffmpeg"].Direction) assert.Equal(t, "oneway", config.Variables["ffmpeg"].Direction)
assert.Equal(t, "/usr/bin/ffmpeg", config.Variables["ffmpeg"].Values[0].Value) assert.Equal(t, "ffmpeg", config.Variables["ffmpeg"].Values[0].Value)
assert.Equal(t, "linux", config.Variables["ffmpeg"].Values[0].Platform) assert.Equal(t, "linux", config.Variables["ffmpeg"].Values[0].Platform)
linuxPVars, ok := config.VariablesLookup["workers"]["linux"] linuxPVars, ok := config.VariablesLookup["workers"]["linux"]