How to use the fs-jetpack.removeAsync function in fs-jetpack

To help you get started, we’ve selected a few fs-jetpack 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 beakerbrowser / beaker-core / dat / daemon / index.js View on Github external
function configureLocalSync (archive, userSettings) {
  var oldLocalSyncSettings = archive.localSyncSettings
  archive.localSyncSettings = getLocalSyncSettings(archive, userSettings)

  if (!isEqual(archive.localSyncSettings, oldLocalSyncSettings)) {
    // configure the local folder watcher if a change occurred
    folderSync.configureFolderToArchiveWatcher(archive)
  }

  if (!archive.localSyncSettings || !archive.localSyncSettings.isUsingInternal) {
    // clear the internal directory if it's not in use
    jetpack.removeAsync(getInternalLocalSyncPath(archive))
  }
}
github RocketChat / Rocket.Chat.Electron / src / main / appData.js View on Github external
async function migrate() {
	const olderAppName = 'Rocket.Chat+';
	const dirName = process.env.NODE_ENV === 'production' ? olderAppName : `${ olderAppName } (${ process.env.NODE_ENV })`;
	const olderUserDataPath = path.join(app.getPath('appData'), dirName);

	try {
		await jetpack.copyAsync(olderUserDataPath, app.getPath('userData'), { overwrite: true });
		await jetpack.removeAsync(olderUserDataPath);
	} catch (error) {
		if (jetpack.exists(olderUserDataPath)) {
			throw error;
		}

		console.log('No data to migrate.');
	}
}
github beakerbrowser / beaker / app / bg / logger.js View on Github external
async function retireLogFile (num) {
  try {
    var p = getLogPath(num)
    var info = await jetpack.inspectAsync(p)
    if (info && info.type === 'file') {
      await jetpack.removeAsync(p)
    }
  } catch (err) {
    console.error('retireLogFile failed', num, err)
  }
}
github beakerbrowser / beaker-core / dbs / archives.js View on Github external
exports.deleteArchive = async function (key) {
  const path = getArchiveMetaPath(key)
  const info = await jetpack.inspectTreeAsync(path)
  await Promise.all([
    db.run(`DELETE FROM archives WHERE key=?`, key),
    db.run(`DELETE FROM archives_meta WHERE key=?`, key),
    db.run(`DELETE FROM archives_meta_type WHERE key=?`, key),
    jetpack.removeAsync(path),
    jetpack.removeAsync(getInternalLocalSyncPath(key))
  ])
  return info.size
}
github beakerbrowser / beaker / app / bg / dbs / archives.js View on Github external
export async function deleteArchive (key) {
  const path = getArchiveMetaPath(key)
  const info = await jetpack.inspectTreeAsync(path)
  await Promise.all([
    db.run(`DELETE FROM archives WHERE key=?`, key),
    db.run(`DELETE FROM archives_meta WHERE key=?`, key),
    jetpack.removeAsync(path)
  ])
  return info ? info.size : 0
}
github RocketChat / Rocket.Chat.Electron / gulpfile.js View on Github external
task('icons:clean', async () => {
	await removeAsync('src/public/images/tray/darwin');
	await removeAsync('src/public/images/tray/darwin-dark');
	await removeAsync('src/public/images/tray/linux');
	await removeAsync('src/public/images/tray/win32');
});
github RocketChat / Rocket.Chat.Electron / gulpfile.js View on Github external
task('icons:clean', async () => {
	await removeAsync('src/public/images/tray/darwin');
	await removeAsync('src/public/images/tray/darwin-dark');
	await removeAsync('src/public/images/tray/linux');
	await removeAsync('src/public/images/tray/win32');
});
github beakerbrowser / beaker-core / dbs / archives.js View on Github external
exports.deleteArchive = async function (key) {
  const path = getArchiveMetaPath(key)
  const info = await jetpack.inspectTreeAsync(path)
  await Promise.all([
    db.run(`DELETE FROM archives WHERE key=?`, key),
    db.run(`DELETE FROM archives_meta WHERE key=?`, key),
    db.run(`DELETE FROM archives_meta_type WHERE key=?`, key),
    jetpack.removeAsync(path),
    jetpack.removeAsync(getInternalLocalSyncPath(key))
  ])
  return info.size
}
github RocketChat / Rocket.Chat.Electron / tasks / icons.js View on Github external
gulp.task('icons:clean', async () => {
	await jetpack.removeAsync('src/public/images/tray/darwin');
	await jetpack.removeAsync('src/public/images/tray/darwin-dark');
	await jetpack.removeAsync('src/public/images/tray/linux');
	await jetpack.removeAsync('src/public/images/tray/win32');
});