Skip to content

Commit

Permalink
working on windows (:
Browse files Browse the repository at this point in the history
  • Loading branch information
sero committed Jul 3, 2024
1 parent 7659624 commit 03230f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/cache/src/createCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { getUniqueWalletSetupFunctions } from './utils/getUniqueWalletSetupFunct
import { triggerCacheCreation } from './utils/triggerCacheCreation'

export async function createCache(walletSetupDirPath: string, downloadExtension: () => Promise<string>, force = false) {
console.log('made it in createCache', walletSetupDirPath, downloadExtension)
console.log('1. made it in createCache', walletSetupDirPath, downloadExtension)
const setupFunctions = await getUniqueWalletSetupFunctions(walletSetupDirPath)

console.log('2. received setup functions', setupFunctions)
const cacheCreationPromises = await triggerCacheCreation(setupFunctions, downloadExtension, force)

console.log('3. cache creation promise, triggered', cacheCreationPromises)
if (cacheCreationPromises.length === 0) {
console.log('No new setup functions to cache. Exiting...')
return
}

console.log('4. created and exiting')
// TODO: This line has no unit test. Not sure how to do it. Look into it later.
await Promise.all(cacheCreationPromises)

Expand Down
2 changes: 1 addition & 1 deletion packages/cache/src/utils/getWalletSetupFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export async function getWalletSetupFiles(walletSetupDirPath: string) {
].join('\n')
)
}

console.log('get wallet setup files', fileList)
return fileList
}
5 changes: 3 additions & 2 deletions packages/cache/src/utils/importWalletSetupFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const WalletSetupModule = z.object({
})

export async function importWalletSetupFile(walletSetupFilePath: string) {
const walletSetupModule = await import(walletSetupFilePath)

console.log('import wallet setup files', walletSetupFilePath)
const walletSetupModule = await import('file:\\\\\\' + walletSetupFilePath)
console.log('2.2. walletsetup module', walletSetupModule)
const result = WalletSetupModule.safeParse(walletSetupModule)
if (!result.success) {
throw new Error(
Expand Down

0 comments on commit 03230f2

Please sign in to comment.