|
|
|
@ -43,6 +43,7 @@ export const getBackendsFromLocations = (locations: Locations): string[] => {
|
|
|
|
|
|
|
|
|
|
export const checkAndConfigureBackend = (name: string, backend: Backend) => {
|
|
|
|
|
const writer = new Writer(name.blue + ' : ' + 'Configuring... ⏳')
|
|
|
|
|
try {
|
|
|
|
|
const env = getEnvFromBackend(backend)
|
|
|
|
|
|
|
|
|
|
const { out, err } = exec('restic', ['init'], { env })
|
|
|
|
@ -53,6 +54,9 @@ export const checkAndConfigureBackend = (name: string, backend: Backend) => {
|
|
|
|
|
if (VERBOSE && out.length > 0) console.log(out)
|
|
|
|
|
|
|
|
|
|
writer.done(name.blue + ' : ' + 'Done ✓'.green)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
writer.done(name.blue + ' : ' + 'Error ⚠️ ' + e.message.red)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const checkAndConfigureBackends = (backends?: Backends) => {
|
|
|
|
|