@walruswebdev/daily-devhabit-cli 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -9
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -65,7 +65,7 @@ program
|
|
|
65
65
|
.alias('l')
|
|
66
66
|
.description('Create a new engineering log entry')
|
|
67
67
|
.action(async () => {
|
|
68
|
-
const token = config.get('auth.token')
|
|
68
|
+
const token = config.get('auth.token')?.trim();
|
|
69
69
|
const lastProject = config.get('lastProject') || ''; // Memory feature
|
|
70
70
|
if (!token) {
|
|
71
71
|
console.log('❌ You are not logged in. Please run: ddh login');
|
|
@@ -128,13 +128,16 @@ program
|
|
|
128
128
|
});
|
|
129
129
|
console.log(`\n✅ Log Saved! (ID: ${response.data.id})`);
|
|
130
130
|
console.log(` Stored in: Cloud Database`);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
const syncUrl = config.get('sync.url') || process.env.DDH_SYNC_URL;
|
|
132
|
+
if (syncUrl && typeof syncUrl === 'string') {
|
|
133
|
+
try {
|
|
134
|
+
// Adding {} as the second argument (the body) and the URL as the first
|
|
135
|
+
await axios_1.default.post('https://ddh-notion-bridge-production.up.railway.app/webhook/sync', {}, { timeout: 3000 });
|
|
136
|
+
console.log('✨ Notion tables synced via bridge.');
|
|
137
|
+
}
|
|
138
|
+
catch (e) {
|
|
139
|
+
// Quietly fail
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
catch (error) {
|
|
@@ -191,7 +194,7 @@ program
|
|
|
191
194
|
.description('Download all cloud logs to a timestamped Markdown file')
|
|
192
195
|
.action(async () => {
|
|
193
196
|
// 1. Get Token
|
|
194
|
-
const token = config.get('auth.token')
|
|
197
|
+
const token = config.get('auth.token')?.trim();
|
|
195
198
|
if (!token) {
|
|
196
199
|
console.error('❌ Authentication required. Please run "ddh login" first.');
|
|
197
200
|
return;
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walruswebdev/daily-devhabit-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Package for Daily Dev Habit CLI Tool",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ddh": "bin/ddh.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsc"
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"release": "npm version patch && npm publish --access public"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"dist",
|