Manager: handle inconsistent trailing path separator in two-way variables #104293

Open
opened 2024-03-28 12:33:12 +01:00 by Sybren A. Stüvel · 0 comments

With a configuration like this, the path replacement may go wrong, as one path ends in a path separator and others don't:

variables:
  my_storage:
    is_twoway: true
    values:
    - platform: linux
      value: /media/shared
    - platform: windows
      value: F:\
    - platform: darwin
      value: /Volumes/shared

Two approaches to adress this come to mind:

  1. Warn when the configuration is inconsistent
  2. Assume that only entire paths are to be replaced (so the above should not replace /Volumes/shared-drive with {my_storage}-drive) so the trailing path separator can be appended implicitly.

The last one is preferred, as it doesn't require the user to update their configuration.

With a configuration like this, the path replacement may go wrong, as one path ends in a path separator and others don't: ```yaml variables: my_storage: is_twoway: true values: - platform: linux value: /media/shared - platform: windows value: F:\ - platform: darwin value: /Volumes/shared ``` Two approaches to adress this come to mind: 1. Warn when the configuration is inconsistent 2. Assume that only entire paths are to be replaced (so the above should not replace `/Volumes/shared-drive` with `{my_storage}-drive`) so the trailing path separator can be appended implicitly. The last one is preferred, as it doesn't require the user to update their configuration.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/flamenco#104293
No description provided.