flingit 0.0.11 → 0.0.12
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.
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Prompt the user to select where to create
|
|
2
|
+
* Prompt the user to select where to create a new Fling project.
|
|
3
3
|
*/
|
|
4
4
|
import type { LaunchIO, PromptNewProjectResult } from "./launch-io.js";
|
|
5
5
|
/**
|
|
6
|
-
* Prompt the user to
|
|
6
|
+
* Prompt the user to select a location for creating a new project.
|
|
7
|
+
*
|
|
8
|
+
* Note: This function is called AFTER the user has already chosen
|
|
9
|
+
* "Create new project" in the project selector. It should only offer
|
|
10
|
+
* creation options, not options to open existing projects.
|
|
7
11
|
*
|
|
8
12
|
* @param io - The launch I/O context
|
|
9
13
|
* @returns The chosen directory path, or null if cancelled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-new-project.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/prompt-new-project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEvE
|
|
1
|
+
{"version":3,"file":"prompt-new-project.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/prompt-new-project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,QAAQ,GACX,OAAO,CAAC,sBAAsB,CAAC,CAwDjC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Prompt the user to select where to create
|
|
2
|
+
* Prompt the user to select where to create a new Fling project.
|
|
3
3
|
*/
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
5
|
/**
|
|
6
|
-
* Prompt the user to
|
|
6
|
+
* Prompt the user to select a location for creating a new project.
|
|
7
|
+
*
|
|
8
|
+
* Note: This function is called AFTER the user has already chosen
|
|
9
|
+
* "Create new project" in the project selector. It should only offer
|
|
10
|
+
* creation options, not options to open existing projects.
|
|
7
11
|
*
|
|
8
12
|
* @param io - The launch I/O context
|
|
9
13
|
* @returns The chosen directory path, or null if cancelled
|
|
@@ -14,19 +18,14 @@ export async function promptNewProject(io) {
|
|
|
14
18
|
const options = [];
|
|
15
19
|
// Check ~/fling status
|
|
16
20
|
const flingHomeExists = file.exists(flingHome);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
else if (!flingHomeExists) {
|
|
26
|
-
// ~/fling doesn't exist - offer to create it there
|
|
21
|
+
// Only offer ~/fling as a creation option if it doesn't exist.
|
|
22
|
+
// If ~/fling exists (whether as a project or not), don't offer it.
|
|
23
|
+
// Note: If user wanted to open an existing project, they should have
|
|
24
|
+
// selected it in the project selector - this function is only called
|
|
25
|
+
// AFTER user chose "Create new project".
|
|
26
|
+
if (!flingHomeExists) {
|
|
27
27
|
options.push({ value: flingHome, label: "Start in ~/fling" });
|
|
28
28
|
}
|
|
29
|
-
// If ~/fling exists but is NOT a project, don't show either option
|
|
30
29
|
// Suggest current directory only if it's empty (and not ~/fling)
|
|
31
30
|
if (cwd !== flingHome && file.isDirEmpty(cwd)) {
|
|
32
31
|
options.push({
|
|
@@ -43,10 +42,6 @@ export async function promptNewProject(io) {
|
|
|
43
42
|
if (user.isCancel(choice) || choice === "cancel") {
|
|
44
43
|
return null;
|
|
45
44
|
}
|
|
46
|
-
if (choice === "open-existing") {
|
|
47
|
-
// User wants to open the existing project at ~/fling
|
|
48
|
-
return flingHome;
|
|
49
|
-
}
|
|
50
45
|
if (choice === "enter-path") {
|
|
51
46
|
const entered = await user.text({
|
|
52
47
|
message: "Enter the path for your new project:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-new-project.js","sourceRoot":"","sources":["../../../src/cli/utils/prompt-new-project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C
|
|
1
|
+
{"version":3,"file":"prompt-new-project.js","sourceRoot":"","sources":["../../../src/cli/utils/prompt-new-project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,EAAY;IAEZ,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACjC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1C,MAAM,OAAO,GAAuC,EAAE,CAAC;IAEvD,uBAAuB;IACvB,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAE/C,+DAA+D;IAC/D,mEAAmE;IACnE,qEAAqE;IACrE,qEAAqE;IACrE,yCAAyC;IACzC,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,iEAAiE;IACjE,IAAI,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,+BAA+B,GAAG,GAAG;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7D,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