Skip to content

Commit

Permalink
fix: removed deleteOnFinish
Browse files Browse the repository at this point in the history
Signed-off-by: blu3beri <[email protected]>
  • Loading branch information
blu3beri committed Apr 4, 2023
1 parent c46a6b8 commit 4548907
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,27 @@ export class IndySdkToAskarMigrationUpdater {
private agent: Agent
private dbPath: string
private fs: FileSystem
private deleteOnFinish: boolean

private constructor(
walletConfig: WalletConfig,
agent: Agent,
dbPath: string,
deleteOnFinish = false,
defaultLinkSecretId?: string
) {
this.walletConfig = walletConfig
this.dbPath = dbPath
this.agent = agent
this.fs = this.agent.dependencyManager.resolve<FileSystem>(InjectionSymbols.FileSystem)
this.defaultLinkSecretId = defaultLinkSecretId ?? walletConfig.id
this.deleteOnFinish = deleteOnFinish
}

public static async initialize({
dbPath,
agent,
deleteOnFinish,
defaultLinkSecretId,
}: {
dbPath: string
agent: Agent
deleteOnFinish?: boolean
defaultLinkSecretId?: string
}) {
const {
Expand Down Expand Up @@ -83,7 +78,7 @@ export class IndySdkToAskarMigrationUpdater {
throw new IndySdkToAskarMigrationError("Wallet on the agent must be of instance 'AskarWallet'")
}

return new IndySdkToAskarMigrationUpdater(walletConfig, agent, dbPath, deleteOnFinish, defaultLinkSecretId)
return new IndySdkToAskarMigrationUpdater(walletConfig, agent, dbPath, defaultLinkSecretId)
}

/**
Expand Down Expand Up @@ -186,9 +181,6 @@ export class IndySdkToAskarMigrationUpdater {

// Copy the file from the database path to the new location
await this.fs.copyFile(src, dest)

// Delete the original, only if specified by the user
if (this.deleteOnFinish) await this.fs.delete(this.dbPath)
}

/**
Expand Down

0 comments on commit 4548907

Please sign in to comment.