remove duplicated code and make the forget function compatible with the new docker mounts options

This commit is contained in:
cupcakearmy
2019-12-24 17:31:44 +01:00
parent 9ece1d867d
commit 886b6362cd
4 changed files with 24 additions and 10 deletions

View File

@@ -15,7 +15,8 @@ import {
MeasureDuration,
fill,
decodeLocationFromPrefix,
hash, checkIfDockerVolumeExistsOrFail,
checkIfDockerVolumeExistsOrFail,
getPathFromVolume,
} from './utils'
@@ -33,7 +34,7 @@ export const backupFromFilesystem = (from: string, location: Location, backend:
}
export const backupFromVolume = (volume: string, location: Location, backend: Backend) => {
const tmp = pathRelativeToConfigFile(hash(volume))
const tmp = getPathFromVolume(volume)
try {
mkdirSync(tmp)
checkIfDockerVolumeExistsOrFail(volume)