From fb48962b947358e90a76e87a7794adb6057de476 Mon Sep 17 00:00:00 2001 From: Cedric Staniewski Date: Wed, 10 Jul 2019 22:58:08 +0200 Subject: [PATCH] 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. --- lib/versioner/external.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/versioner/external.go b/lib/versioner/external.go index d2276fe05..32f8e5504 100644 --- a/lib/versioner/external.go +++ b/lib/versioner/external.go @@ -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 {