lib/versioner: Add placeholder to provide the absolute file path to external commands

This commit adds support for a new placeholder, %FILE_PATH_FULL%, to the
command of the external versioner. The placeholder will be replaced by
the absolute path of the file that should be deleted.
This commit is contained in:
Cedric Staniewski
2019-07-10 22:58:08 +02:00
parent 3446d50201
commit fb48962b94

View File

@@ -10,6 +10,7 @@ import (
"errors"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
@@ -74,6 +75,7 @@ func (v External) Archive(filePath string) error {
"%FOLDER_FILESYSTEM%": v.filesystem.Type().String(),
"%FOLDER_PATH%": v.filesystem.URI(),
"%FILE_PATH%": filePath,
"%FILE_PATH_FULL%": filepath.Join(v.filesystem.URI(), filePath),
}
for i, word := range words {