@dbcube/core 1.0.30 → 1.0.34
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/bin.cjs +3 -3
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +3 -3
- package/dist/bin.js.map +1 -1
- package/dist/index.cjs +26 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -233,7 +233,7 @@ var Downloader = class {
|
|
|
233
233
|
extracting: chalk.yellow("extrayendo"),
|
|
234
234
|
completed: chalk.green("completado"),
|
|
235
235
|
exists: chalk.gray("existe"),
|
|
236
|
-
retrying: chalk.
|
|
236
|
+
retrying: chalk.yellow(`reintentando (${attempt}/${3})`)
|
|
237
237
|
};
|
|
238
238
|
const emoji = statusEmojis[status] || "\u{1F4E5}";
|
|
239
239
|
const message = statusMessages[status] || status;
|
|
@@ -351,7 +351,7 @@ var Downloader = class {
|
|
|
351
351
|
}
|
|
352
352
|
static getDefaultBinDir() {
|
|
353
353
|
const possibleDirs = [
|
|
354
|
-
path.resolve(process.cwd(), "bin"),
|
|
354
|
+
path.resolve(process.cwd(), ".dbcube", "bin"),
|
|
355
355
|
path.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
|
|
356
356
|
path.resolve(__dirname, "..", "bin")
|
|
357
357
|
];
|
|
@@ -368,7 +368,7 @@ var Downloader = class {
|
|
|
368
368
|
continue;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
const tempDir = path.join(os2.tmpdir(), "dbcube
|
|
371
|
+
const tempDir = path.join(os2.tmpdir(), ".dbcube", "bin");
|
|
372
372
|
fs.mkdirSync(tempDir, { recursive: true });
|
|
373
373
|
return tempDir;
|
|
374
374
|
}
|
|
@@ -377,6 +377,7 @@ var Downloader = class {
|
|
|
377
377
|
// src/lib/Binary.ts
|
|
378
378
|
import * as fs2 from "fs";
|
|
379
379
|
import * as path2 from "path";
|
|
380
|
+
import * as os3 from "os";
|
|
380
381
|
var Binary = class {
|
|
381
382
|
static isDownloading = false;
|
|
382
383
|
static downloadPromise = null;
|
|
@@ -418,7 +419,7 @@ var Binary = class {
|
|
|
418
419
|
}
|
|
419
420
|
static getBinDir() {
|
|
420
421
|
const possibleDirs = [
|
|
421
|
-
path2.resolve(process.cwd(), "bin"),
|
|
422
|
+
path2.resolve(process.cwd(), ".dbcube", "bin"),
|
|
422
423
|
path2.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
|
|
423
424
|
path2.resolve(__dirname, "..", "bin")
|
|
424
425
|
];
|
|
@@ -427,12 +428,32 @@ var Binary = class {
|
|
|
427
428
|
if (!fs2.existsSync(dir)) {
|
|
428
429
|
fs2.mkdirSync(dir, { recursive: true });
|
|
429
430
|
}
|
|
431
|
+
if (dir.includes(path2.resolve(process.cwd(), ".dbcube"))) {
|
|
432
|
+
this.ensureGitIgnore(path2.resolve(process.cwd(), ".dbcube"));
|
|
433
|
+
}
|
|
430
434
|
return dir;
|
|
431
435
|
} catch {
|
|
432
436
|
continue;
|
|
433
437
|
}
|
|
434
438
|
}
|
|
435
|
-
|
|
439
|
+
const tempDir = path2.join(os3.tmpdir(), ".dbcube", "bin");
|
|
440
|
+
fs2.mkdirSync(tempDir, { recursive: true });
|
|
441
|
+
return tempDir;
|
|
442
|
+
}
|
|
443
|
+
static ensureGitIgnore(dbcubeDir) {
|
|
444
|
+
try {
|
|
445
|
+
const gitignorePath = path2.join(dbcubeDir, ".gitignore");
|
|
446
|
+
if (!fs2.existsSync(gitignorePath)) {
|
|
447
|
+
const gitignoreContent = `# DBCube binaries
|
|
448
|
+
bin/
|
|
449
|
+
*.exe
|
|
450
|
+
*.log
|
|
451
|
+
*.tmp
|
|
452
|
+
`;
|
|
453
|
+
fs2.writeFileSync(gitignorePath, gitignoreContent);
|
|
454
|
+
}
|
|
455
|
+
} catch {
|
|
456
|
+
}
|
|
436
457
|
}
|
|
437
458
|
static async get() {
|
|
438
459
|
await this.ensureBinariesExist();
|