sandstone-cli 1.2.3 → 1.2.4
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/lib/commands/create.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +2 -2
- package/package.json +1 -1
- package/src/commands/create.ts +1 -1
- package/src/shared.ts +1 -1
- package/src/utils.ts +2 -2
package/lib/commands/create.js
CHANGED
|
@@ -110,7 +110,7 @@ export async function createCommand(_project, opts) {
|
|
|
110
110
|
name: 'world',
|
|
111
111
|
message: 'What world do you want to save the packs in? >',
|
|
112
112
|
type: 'list',
|
|
113
|
-
choices: getWorldsList,
|
|
113
|
+
choices: () => getWorldsList(saveOptions.clientPath),
|
|
114
114
|
});
|
|
115
115
|
saveOptions.world = world;
|
|
116
116
|
break;
|
package/lib/utils.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export declare const capitalize: (s: string) => string;
|
|
|
22
22
|
* Get the .minecraft path
|
|
23
23
|
*/
|
|
24
24
|
export declare function getMinecraftPath(): string;
|
|
25
|
-
export declare function getWorldsList(): string[];
|
|
25
|
+
export declare function getWorldsList(clientPath?: string): string[];
|
package/lib/utils.js
CHANGED
|
@@ -82,8 +82,8 @@ export function getMinecraftPath() {
|
|
|
82
82
|
}
|
|
83
83
|
return mcPath;
|
|
84
84
|
}
|
|
85
|
-
export function getWorldsList() {
|
|
86
|
-
const mcPath = getMinecraftPath();
|
|
85
|
+
export function getWorldsList(clientPath) {
|
|
86
|
+
const mcPath = clientPath || getMinecraftPath();
|
|
87
87
|
const savesPath = path.join(mcPath, 'saves');
|
|
88
88
|
return fs.readdirSync(savesPath, { withFileTypes: true }).filter((f) => f.isDirectory).map((f) => f.name);
|
|
89
89
|
}
|
package/package.json
CHANGED
package/src/commands/create.ts
CHANGED
|
@@ -143,7 +143,7 @@ export async function createCommand(_project: string, opts: CreateOptions) {
|
|
|
143
143
|
name: 'world',
|
|
144
144
|
message: 'What world do you want to save the packs in? >',
|
|
145
145
|
type: 'list',
|
|
146
|
-
choices: getWorldsList,
|
|
146
|
+
choices: () => getWorldsList(saveOptions.clientPath),
|
|
147
147
|
})
|
|
148
148
|
saveOptions.world = world
|
|
149
149
|
break
|
package/src/shared.ts
CHANGED
|
@@ -17,6 +17,6 @@ export const BuildDeclares = {
|
|
|
17
17
|
serverPath: ['--server-path <path>', 'Path of the server folder. Override the value specified in the configuration file.'],
|
|
18
18
|
|
|
19
19
|
// TODO: ssh
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
enableSymlinks: ['--enable-symlinks', 'Force enable/disable symlinks. Defaults to false. Useful if you want to enable symlinks on Windows.'],
|
|
22
22
|
} as unknown as Record<string, [string, string, RegExp, boolean]> // Haha TypeScript funny
|
package/src/utils.ts
CHANGED
|
@@ -98,8 +98,8 @@ export function getMinecraftPath(): string {
|
|
|
98
98
|
return mcPath
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export function getWorldsList(): string[] {
|
|
102
|
-
const mcPath = getMinecraftPath()
|
|
101
|
+
export function getWorldsList(clientPath?: string): string[] {
|
|
102
|
+
const mcPath = clientPath || getMinecraftPath()
|
|
103
103
|
const savesPath = path.join(mcPath, 'saves')
|
|
104
104
|
|
|
105
105
|
return fs.readdirSync(
|