Skip to content

Commit

Permalink
Merge pull request #5 from jazzina/dev-001
Browse files Browse the repository at this point in the history
use wakatime.cfg if API key is empty
  • Loading branch information
uioporqwerty committed Feb 10, 2024
2 parents a18cd93 + ffb15bf commit d28166b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "name": "joplin-plugin-wakatime", "version": "1.0.13", "scripts": { "dist": "webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive", "dist:dev": "webpack -d --joplin-plugin-config buildMain && webpack -d --joplin-plugin-config buildExtraScripts && webpack -d --joplin-plugin-config createArchive && /Applications/Joplin.app/Contents/MacOS/Joplin --env dev", "update": "npm install -g generator-joplin && yo joplin --update" }, "license": "MIT", "keywords": [ "joplin-plugin", "wakatime" ], "files": [ "publish" ], "browser": { "fs": false, "child_process": false }, "devDependencies": { "@types/node": "^14.0.14", "chalk": "^4.1.0", "copy-webpack-plugin": "^6.1.0", "fs-extra": "^9.0.1", "glob": "^7.1.6", "on-build-webpack": "^0.1.0", "tar": "^6.0.5", "ts-loader": "^7.0.5", "typescript": "^3.9.3", "webpack": "^4.43.0", "webpack-cli": "^3.3.11", "yargs": "^16.2.0" }, "dependencies": { "@types/jszip": "^3.4.1", "@types/request": "^2.48.8", "@types/which": "^2.0.1", "compare-versions": "^5.0.1", "jszip": "^3.10.1", "mixpanel-browser": "^2.45.0", "request": "^2.88.2", "rollbar": "^2.25.2", "which": "^2.0.2" } }
{ "name": "joplin-plugin-wakatime", "version": "1.0.14", "scripts": { "dist": "webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive", "dist:dev": "webpack -d --joplin-plugin-config buildMain && webpack -d --joplin-plugin-config buildExtraScripts && webpack -d --joplin-plugin-config createArchive && /Applications/Joplin.app/Contents/MacOS/Joplin --env dev", "update": "npm install -g generator-joplin && yo joplin --update" }, "license": "MIT", "keywords": [ "joplin-plugin", "wakatime" ], "files": [ "publish" ], "browser": { "fs": false, "child_process": false }, "devDependencies": { "@types/node": "^14.0.14", "chalk": "^4.1.0", "copy-webpack-plugin": "^6.1.0", "fs-extra": "^9.0.1", "glob": "^7.1.6", "on-build-webpack": "^0.1.0", "tar": "^6.0.5", "ts-loader": "^7.0.5", "typescript": "^3.9.3", "webpack": "^4.43.0", "webpack-cli": "^3.3.11", "yargs": "^16.2.0" }, "dependencies": { "@types/jszip": "^3.4.1", "@types/request": "^2.48.8", "@types/which": "^2.0.1", "compare-versions": "^5.0.1", "jszip": "^3.10.1", "mixpanel-browser": "^2.45.0", "request": "^2.88.2", "rollbar": "^2.25.2", "which": "^2.0.2" } }
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "manifest_version": 1, "id": "app.nybble.joplin-plugin-wakatime", "app_min_version": "2.8", "version": "1.0.13", "name": "WakaTime", "description": "A Joplin plugin for WakaTime", "author": "Nitish Sachar (uioporqwerty)", "homepage_url": "https://github.com/uioporqwerty/joplin-plugin-wakatime", "repository_url": "https://github.com/uioporqwerty/joplin-plugin-wakatime", "keywords": [ "wakatime", "tracking" ], "categories": [ "developer tools", "integrations", "productivity" ] }
{ "manifest_version": 1, "id": "app.nybble.joplin-plugin-wakatime", "app_min_version": "2.8", "version": "1.0.14", "name": "WakaTime", "description": "A Joplin plugin for WakaTime", "author": "Nitish Sachar (uioporqwerty)", "homepage_url": "https://github.com/uioporqwerty/joplin-plugin-wakatime", "repository_url": "https://github.com/uioporqwerty/joplin-plugin-wakatime", "keywords": [ "wakatime", "tracking" ], "categories": [ "developer tools", "integrations", "productivity" ] }
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Settings {
public: true,
type: SettingItemType.String,
label: "WakaTime API Key",
description: "Requires restart",
description: "Uses ~/.wakatime.cfg if empty. Requires restart",
value: "",
secure: true,
section: this.SECTION,
Expand Down
6 changes: 4 additions & 2 deletions src/wakatime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ export class WakaTime {
quote(user_agent),
"--entity-type",
"app",
"--key",
quote(apiKey),
"--category",
"designing", // TODO: Replace with a different category once the cli allows.
];

if (apiKey) {
args.push("--key", quote(apiKey));
}

let project = folder.title;
if (project) {
args.push("--project", quote(project));
Expand Down

0 comments on commit d28166b

Please sign in to comment.