({
appName,
type,
restoreType,
credentials,
serviceName,
rcloneCommand,
backupFile,
}: RestoreOptions)
| 105 | } |
| 106 | |
| 107 | export const getRestoreCommand = ({ |
| 108 | appName, |
| 109 | type, |
| 110 | restoreType, |
| 111 | credentials, |
| 112 | serviceName, |
| 113 | rcloneCommand, |
| 114 | backupFile, |
| 115 | }: RestoreOptions) => { |
| 116 | const containerSearch = getComposeSearchCommand( |
| 117 | appName, |
| 118 | restoreType, |
| 119 | serviceName, |
| 120 | ); |
| 121 | const restoreCommand = generateRestoreCommand(type, credentials); |
| 122 | let cmd = `CONTAINER_ID=$(${containerSearch})`; |
| 123 | |
| 124 | if (type !== "mongo") { |
| 125 | cmd += ` && ${rcloneCommand} | ${restoreCommand}`; |
| 126 | } else { |
| 127 | cmd += ` && ${getMongoSpecificCommand(rcloneCommand, restoreCommand, backupFile || "")}`; |
| 128 | } |
| 129 | |
| 130 | return cmd; |
| 131 | }; |
no test coverage detected