@luutuankiet/gsd-reader 0.2.22 → 0.2.23
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/cli.cjs +5 -5
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -56,8 +56,8 @@ const positionalArgs = args.filter(a => !a.startsWith('--') && a !== command);
|
|
|
56
56
|
|
|
57
57
|
async function commandDump() {
|
|
58
58
|
const worklogPath = positionalArgs[0] || './gsd-lite/WORK.md';
|
|
59
|
-
const remote = getFlag('remote');
|
|
60
|
-
const user = getFlag('user');
|
|
59
|
+
const remote = getFlag('remote') || process.env.GSD_READER_REMOTE;
|
|
60
|
+
const user = getFlag('user') || process.env.GSD_READER_USER;
|
|
61
61
|
|
|
62
62
|
if (!remote) {
|
|
63
63
|
console.error('❌ --remote=URL is required');
|
|
@@ -144,7 +144,7 @@ async function commandDump() {
|
|
|
144
144
|
console.log(`[dump] Archive created: ${(tarStats.size / 1024).toFixed(1)} KB`);
|
|
145
145
|
|
|
146
146
|
// Step 3: Get password
|
|
147
|
-
let password = getFlag('pass');
|
|
147
|
+
let password = getFlag('pass') || process.env.GSD_READER_PASS;
|
|
148
148
|
if (!password && user) {
|
|
149
149
|
password = await promptPassword(`Password for ${user}: `);
|
|
150
150
|
}
|
|
@@ -244,7 +244,7 @@ function promptPassword(prompt) {
|
|
|
244
244
|
|
|
245
245
|
async function httpRequest(url, options, data) {
|
|
246
246
|
const controller = new AbortController();
|
|
247
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
247
|
+
const timeout = setTimeout(() => controller.abort(), 300000); // 5 min (intercontinental uploads)
|
|
248
248
|
|
|
249
249
|
try {
|
|
250
250
|
const res = await fetch(url, {
|
|
@@ -265,7 +265,7 @@ async function httpRequest(url, options, data) {
|
|
|
265
265
|
}
|
|
266
266
|
} catch (err) {
|
|
267
267
|
if (err.name === 'AbortError') {
|
|
268
|
-
throw new Error('Request timed out after
|
|
268
|
+
throw new Error('Request timed out after 300s. Check server/proxy status.');
|
|
269
269
|
}
|
|
270
270
|
throw err;
|
|
271
271
|
} finally {
|