mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
71efff6827
* Update eslint config * Applied linter to lib * Applied eslint config to CliClient/app * Removed prettier due to https://github.com/prettier/prettier/pull/4765 * First pass on test units * Applied linter config to test units * Applied eslint config to clipper * Applied to plugin dir * Applied to root of ElectronClient * Applied on RN root * Applied on CLI root * Applied on Clipper root * Applied config to tools * test hook * test hook * test hook * Added pre-commit hook * Applied rule no-trailing-spaces * Make sure root packages are installed when installing sub-dir * Added doc
37 lines
826 B
JavaScript
37 lines
826 B
JavaScript
const { BaseCommand } = require('./base-command.js');
|
|
const { app } = require('./app.js');
|
|
const Setting = require('lib/models/Setting.js');
|
|
const { ReportService } = require('lib/services/report.js');
|
|
const fs = require('fs-extra');
|
|
|
|
class Command extends BaseCommand {
|
|
usage() {
|
|
return 'export-sync-status';
|
|
}
|
|
|
|
description() {
|
|
return 'Export sync status';
|
|
}
|
|
|
|
hidden() {
|
|
return true;
|
|
}
|
|
|
|
async action(args) {
|
|
const service = new ReportService();
|
|
const csv = await service.basicItemList({ format: 'csv' });
|
|
const filePath = Setting.value('profileDir') + '/syncReport-' + new Date().getTime() + '.csv';
|
|
await fs.writeFileSync(filePath, csv);
|
|
this.stdout('Sync status exported to ' + filePath);
|
|
|
|
app()
|
|
.gui()
|
|
.showConsole();
|
|
app()
|
|
.gui()
|
|
.maximizeConsole();
|
|
}
|
|
}
|
|
|
|
module.exports = Command;
|