snapfail 0.0.11 → 0.0.13
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 +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { join, resolve, basename } from "path";
|
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
7
7
|
import { createServer } from "http";
|
|
8
8
|
import { spawn, execSync } from "child_process";
|
|
9
|
-
var VERSION = "0.0.
|
|
9
|
+
var VERSION = "0.0.13";
|
|
10
10
|
var APP_URL = process.env["SNAPFAIL_APP_URL"] ?? "https://app.snapfail.com";
|
|
11
11
|
var AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
12
12
|
var c = {
|
|
@@ -334,17 +334,17 @@ function htmlString(title, body, ok) {
|
|
|
334
334
|
function esc(s) {
|
|
335
335
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
336
336
|
}
|
|
337
|
-
function getInstallCommand(cwd) {
|
|
337
|
+
function getInstallCommand(cwd, version) {
|
|
338
338
|
if (existsSync(join(cwd, "bun.lock")) || existsSync(join(cwd, "bun.lockb"))) {
|
|
339
|
-
return
|
|
339
|
+
return `bun add --exact @snapfail/sdk@${version}`;
|
|
340
340
|
}
|
|
341
341
|
if (existsSync(join(cwd, "pnpm-lock.yaml")) || existsSync(join(cwd, "pnpm-workspace.yaml"))) {
|
|
342
|
-
return
|
|
342
|
+
return `pnpm add --save-exact @snapfail/sdk@${version}`;
|
|
343
343
|
}
|
|
344
344
|
if (existsSync(join(cwd, "yarn.lock"))) {
|
|
345
|
-
return
|
|
345
|
+
return `yarn add --exact @snapfail/sdk@${version}`;
|
|
346
346
|
}
|
|
347
|
-
return
|
|
347
|
+
return `npm install --save-exact @snapfail/sdk@${version}`;
|
|
348
348
|
}
|
|
349
349
|
async function cmdInit(cwd) {
|
|
350
350
|
console.log("");
|
|
@@ -391,7 +391,7 @@ async function cmdInit(cwd) {
|
|
|
391
391
|
success("SnapFail is now integrated into your project!");
|
|
392
392
|
console.log("");
|
|
393
393
|
if (project.kind !== "html") {
|
|
394
|
-
const installCmd = getInstallCommand(cwd);
|
|
394
|
+
const installCmd = getInstallCommand(cwd, VERSION);
|
|
395
395
|
const installNow = await askYesNo("Would you like to automatically install @snapfail/sdk dependency now?", true);
|
|
396
396
|
console.log("");
|
|
397
397
|
if (installNow) {
|