@mastrojs/create-mastro 0.0.8 → 0.0.9
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/README.md +1 -1
- package/index.js +13 -5
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
//@ts-check
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -20,10 +19,19 @@ import { Readable } from "node:stream";
|
|
|
20
19
|
|
|
21
20
|
const userAgent = process.env.npm_config_user_agent;
|
|
22
21
|
|
|
23
|
-
const runtime =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const runtime = (() => {
|
|
23
|
+
if (typeof Deno === "object") {
|
|
24
|
+
return "deno"
|
|
25
|
+
} else if (userAgent?.startsWith("bun/")) {
|
|
26
|
+
// the usual ways to detect Bun don't appear to work in `bun create`
|
|
27
|
+
return "bun";
|
|
28
|
+
} else if (process.argv[2] === "--cloudflare") {
|
|
29
|
+
return "cloudflare";
|
|
30
|
+
} else {
|
|
31
|
+
return "node";
|
|
32
|
+
}
|
|
33
|
+
})();
|
|
34
|
+
|
|
27
35
|
|
|
28
36
|
/**
|
|
29
37
|
* @param {string} path
|