How to use the @celo/contractkit/lib/identity/claims/keybase.keybaseFilePathToProof.split function in @celo/contractkit

To help you get started, we’ve selected a few @celo/contractkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celo-org / celo-monorepo / packages / cli / src / commands / account / claim-keybase.ts View on Github external
async ensureKeybaseFilePathToProof(base: string) {
    const segments = keybaseFilePathToProof.split('/')
    let currentPath = base
    for (let i = 0; i < segments.length - 1; i++) {
      currentPath += segments[i] + '/'
      if (!(await execWith0Exit('keybase', ['fs', 'ls', currentPath], { silent: true }))) {
        await execCmdWithError('keybase', ['fs', 'mkdir', currentPath], { silent: true })
      }
    }
  }
}