Manager: allow setup to finish without Blender #104306
@ -265,14 +265,10 @@ func (f *Flamenco) SaveSetupAssistantConfig(e echo.Context) error {
|
|||||||
|
|
||||||
logger = logger.With().Interface("config", setupAssistantCfg).Logger()
|
logger = logger.With().Interface("config", setupAssistantCfg).Logger()
|
||||||
|
|
||||||
isConfigIncomplete := setupAssistantCfg.BlenderExecutable.Path == "" ||
|
|
||||||
setupAssistantCfg.BlenderExecutable.Input == ""
|
|
||||||
|
|
||||||
if setupAssistantCfg.StorageLocation == "" ||
|
if setupAssistantCfg.StorageLocation == "" ||
|
||||||
!setupAssistantCfg.BlenderExecutable.IsUsable ||
|
isBlenderPathCheckResultIncomplete(setupAssistantCfg.BlenderExecutable) {
|
||||||
isConfigIncomplete && setupAssistantCfg.BlenderExecutable.Source != "default" {
|
logger.Warn().Msg("setup assistant: configuration is invalid or incomplete, unable to accept")
|
||||||
logger.Warn().Msg("setup assistant: configuration is incomplete, unable to accept")
|
return sendAPIError(e, http.StatusBadRequest, "configuration is invalid or incomplete")
|
||||||
return sendAPIError(e, http.StatusBadRequest, "configuration is incomplete")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conf := f.config.Get()
|
conf := f.config.Get()
|
||||||
@ -339,3 +335,27 @@ func flamencoManagerDir() (string, error) {
|
|||||||
func commandNeedsQuoting(cmd string) bool {
|
func commandNeedsQuoting(cmd string) bool {
|
||||||
return strings.ContainsAny(cmd, "\n\t;()")
|
return strings.ContainsAny(cmd, "\n\t;()")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isBlenderPathCheckResultIncomplete(checkResult api.BlenderPathCheckResult) bool {
|
||||||
|
switch checkResult.Source {
|
||||||
|
case api.BlenderPathSourceDefault:
|
||||||
|
if !checkResult.IsUsable {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
case api.BlenderPathSourceFileAssociation:
|
||||||
|
if !checkResult.IsUsable ||
|
||||||
|
checkResult.Path == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
case api.BlenderPathSourceInputPath, api.BlenderPathSourcePathEnvvar:
|
||||||
|
if !checkResult.IsUsable ||
|
||||||
|
checkResult.Path == "" ||
|
||||||
|
checkResult.Input == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user