Skip to content

Commit

Permalink
fix summaries at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Neolex-Security committed Jan 21, 2024
1 parent b7f9743 commit b2ef83c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 564 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
This is an unofficial plugin to link your reports into your obsidian vault.

Install it from the store, set your hackerone username and API token in the settings, then CTRL+P "fetch HackerOne Reports"
You neeed the **dataview** and **templater** plugin if you want the summaries to work.
You neeed the **dataview** plugin if you want the summaries to work.
19 changes: 19 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,36 @@ SORT sum(rows.bounty) DESC\n\
"
export default class H1ObsidianPlugin extends Plugin {
settings: H1ObsidianPluginSettings;


oninstall() {
console.log("H1ObsidianPlugin installed");
}



async onload() {
await this.loadSettings();

this.addSettingTab(new H1ObsidianPluginSettingTab(this.app, this));

try {
await this.app.vault.createFolder(normalizePath(this.settings.directory))
}catch(error){
console.log(error);
new Notice('Error creating folder:', error);
}

try {
await this.app.vault.create(normalizePath(`${this.settings.directory}/bugs-summary-all-time.md`), contentBugSummaryAlltime);
} catch (error) {
console.log(error)
new Notice('Error creating summary file:', error);
}
try {
await this.app.vault.create(normalizePath(`${this.settings.directory}/bugs-summary-current-year.md`), contentBugSummaryCurrentYear);
} catch (error) {
console.log(error)
new Notice('Error creating summary file:', error);
}

Expand All @@ -160,6 +177,8 @@ export default class H1ObsidianPlugin extends Plugin {
callback: () => this.fetchH1Reports(),
});

await this.fetchH1Reports();

}

async loadSettings() {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "hackerone",
"name": "HackerOne",
"version": "1.0.7",
"version": "1.0.8",
"minAppVersion": "0.15.0",
"description": "Unofficial plugin to fetch your bug reports from HackerOne.",
"description": "Unofficial plugin to fetch your bug reports from HackerOne. (needs dataview plugin)",
"author": "Neolex",
"authorUrl": "https://blog.neolex.dev",
"isDesktopOnly": false
Expand Down
Loading

0 comments on commit b2ef83c

Please sign in to comment.