How to use the ipfsd-ctl/src/utils/find-ipfs-executable function in ipfsd-ctl

To help you get started, we’ve selected a few ipfsd-ctl 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 ipfs-shipyard / ipfs-desktop / src / daemon / daemon.js View on Github external
async function cleanup (ipfsd) {
  const log = logger.start('[daemon] cleanup')

  if (!await fs.pathExists(configPath(ipfsd))) {
    cannotConnectDialog(ipfsd.apiAddr)
    throw new Error('cannot tonnect to api')
  }

  log.info('run: ipfs repo fsck')
  const exec = findExecutable('go', app.getAppPath())

  try {
    execFileSync(exec, ['repo', 'fsck'], {
      env: {
        ...process.env,
        IPFS_PATH: ipfsd.repoPath
      }
    })
    log.end()
  } catch (err) {
    log.fail(err)
  }
}
github IPSE-TEAM / ipse-desktop / src / daemon / daemon.js View on Github external
async function cleanup (addr, path) {
  logger.info('[daemon] cleanup: started')

  if (!await fs.pathExists(join(path, 'config'))) {
    cannotConnectDialog(addr)
    throw new Error('cannot tonnect to api')
  }

  logger.info(`[daemon] cleanup: ipfs repo fsck ${path}`)
  const exec = findExecutable('go', app.getAppPath())

  try {
    execFileSync(exec, ['repo', 'fsck'], {
      env: {
        ...process.env,
        IPFS_PATH: path
      }
    })
    logger.info('[daemon] cleanup: completed')
  } catch (err) {
    logger.error(`[daemon] ${err.toString()}`)
  }
}