make the isexisting repo in location check for all repos
This commit is contained in:
parent
60c0778b74
commit
3c7419f401
1 changed files with 4 additions and 4 deletions
|
|
@ -222,9 +222,9 @@ async function importRepositories(repositories: unknown[]): Promise<ImportResult
|
||||||
logger.warn(`Could not build URL for '${r.name}' to check duplicates: ${toError(e).message}`);
|
logger.warn(`Could not build URL for '${r.name}' to check duplicates: ${toError(e).message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For local repos without isExistingRepository, check if the provided path is already a restic repo
|
// For repos without isExistingRepository, check if the location is already a restic repo
|
||||||
// This catches the case where user forgot to set isExistingRepository: true
|
// This catches the case where user forgot to set isExistingRepository: true
|
||||||
if (r.config.backend === "local" && !r.config.isExistingRepository) {
|
if (!r.config.isExistingRepository) {
|
||||||
const isAlreadyRepo = await restic
|
const isAlreadyRepo = await restic
|
||||||
.snapshots({ ...r.config, isExistingRepository: true } as RepositoryConfig)
|
.snapshots({ ...r.config, isExistingRepository: true } as RepositoryConfig)
|
||||||
.then(() => true)
|
.then(() => true)
|
||||||
|
|
@ -235,8 +235,8 @@ async function importRepositories(repositories: unknown[]): Promise<ImportResult
|
||||||
|
|
||||||
if (isAlreadyRepo) {
|
if (isAlreadyRepo) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Skipping '${r.name}': path '${r.config.path}' is already a restic repository. ` +
|
`Skipping '${r.name}': location is already a restic repository. ` +
|
||||||
`Set "isExistingRepository": true to import it, or use a different path for a new repository.`,
|
`Set "isExistingRepository": true to import it, or use a different location for a new repository.`,
|
||||||
);
|
);
|
||||||
result.warnings++;
|
result.warnings++;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue