Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor paths handling / Support backup/remove executables from different environments #1

Open
desseim opened this issue May 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@desseim
Copy link
Owner

desseim commented May 2, 2022

The path parameter preparation / sanitation at the beginning of the script could do with some refactoring, to:

  1. extract path calculation to functions
  2. store Windows / WSL path sets separately
  3. automatically use the path set which matches the environment of the called executable

In other terms, something like this crude pseudocode:

function CalculateWinPath {
    ...
    return $WinPathVars
}
function CalculateWSLPath {
    ...
    return $WSLPathVars
}

# before rdiff-backup execution
$Paths[[RdiffBackupExeEnv]::Win] = CalculateWinPath
$Paths[[RdiffBackupExeEnv]::WSL] = CalculateWSLPath

# when referring to paths:
$Paths[$RdiffBackupExe.Environment]  # for example

Currently it only calculates, stores and uses one type of paths, depending on the environment of the rdiff-backup executable set to be called. This requires both "backup" and "remove" executables to run in the same environment (i.e. Windows or WSL).
This refactoring would allow for removing this current restriction.

@desseim desseim added the enhancement New feature or request label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant