@farming-labs/docs 0.0.26 → 0.0.27
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/cli/index.mjs +3 -8
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -27,11 +27,6 @@ function detectPackageManagerFromLockfile(cwd) {
|
|
|
27
27
|
if (fs.existsSync(path.join(cwd, "package-lock.json"))) return "npm";
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
function detectPackageManager(cwd) {
|
|
31
|
-
const detected = detectPackageManagerFromLockfile(cwd);
|
|
32
|
-
if (detected) return detected;
|
|
33
|
-
return "npm";
|
|
34
|
-
}
|
|
35
30
|
function installCommand(pm) {
|
|
36
31
|
return pm === "yarn" ? "yarn add" : `${pm} add`;
|
|
37
32
|
}
|
|
@@ -2100,10 +2095,10 @@ async function init(options = {}) {
|
|
|
2100
2095
|
s.stop("Files scaffolded");
|
|
2101
2096
|
if (written.length > 0) p.log.success(`Created ${written.length} file${written.length > 1 ? "s" : ""}:\n` + written.map((f) => ` ${pc.green("+")} ${f}`).join("\n"));
|
|
2102
2097
|
if (skipped.length > 0) p.log.info(`Skipped ${skipped.length} existing file${skipped.length > 1 ? "s" : ""}:\n` + skipped.map((f) => ` ${pc.dim("-")} ${f}`).join("\n"));
|
|
2103
|
-
let pm =
|
|
2104
|
-
p.log.info(`Detected ${pc.cyan(pm)}
|
|
2098
|
+
let pm = detectPackageManagerFromLockfile(cwd);
|
|
2099
|
+
if (pm) p.log.info(`Detected ${pc.cyan(pm)} from lockfile`);
|
|
2105
2100
|
const pmAnswerExisting = await p.select({
|
|
2106
|
-
initialValue: pm,
|
|
2101
|
+
...pm ? { initialValue: pm } : {},
|
|
2107
2102
|
message: "Which package manager do you want to use in this project?",
|
|
2108
2103
|
options: [
|
|
2109
2104
|
{
|