@solidstarters/solid-core 1.2.207 → 1.2.209
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/helpers/command.service.d.ts +1 -0
- package/dist/helpers/command.service.d.ts.map +1 -1
- package/dist/helpers/command.service.js +11 -3
- package/dist/helpers/command.service.js.map +1 -1
- package/dist/services/mediaStorageProviders/file-storage-provider.js +1 -1
- package/dist/services/mediaStorageProviders/file-storage-provider.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/helpers/command.service.ts +20 -4
- package/src/services/mediaStorageProviders/file-storage-provider.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.209",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,21 @@ export type CommandWithArgs = {
|
|
|
10
10
|
export class CommandService {
|
|
11
11
|
private readonly logger = new Logger(CommandService.name);
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Escape an argument for Windows CMD shell
|
|
15
|
+
* Wraps in double quotes and escapes internal double quotes
|
|
16
|
+
*/
|
|
17
|
+
private escapeArgForWindows(arg: string): string {
|
|
18
|
+
// If arg contains special characters, wrap in double quotes
|
|
19
|
+
// and escape internal double quotes with backslash
|
|
20
|
+
if (/[{}\s"^&|<>]/.test(arg)) {
|
|
21
|
+
// Escape internal double quotes with backslash for CMD
|
|
22
|
+
const escaped = arg.replace(/"/g, '\\"');
|
|
23
|
+
return `"${escaped}"`;
|
|
24
|
+
}
|
|
25
|
+
return arg;
|
|
26
|
+
}
|
|
27
|
+
|
|
13
28
|
/**
|
|
14
29
|
* Execute a command with arguments array (cross-platform compatible)
|
|
15
30
|
*/
|
|
@@ -20,11 +35,12 @@ export class CommandService {
|
|
|
20
35
|
return new Promise<string>((resolve, reject) => {
|
|
21
36
|
const isWindows = process.platform === 'win32';
|
|
22
37
|
|
|
23
|
-
// On Windows, we need to
|
|
24
|
-
const
|
|
25
|
-
|
|
38
|
+
// On Windows with shell: true, we need to escape args containing special characters
|
|
39
|
+
const spawnArgs = isWindows
|
|
40
|
+
? args.map(arg => this.escapeArgForWindows(arg))
|
|
41
|
+
: args;
|
|
26
42
|
|
|
27
|
-
const child = spawn(
|
|
43
|
+
const child = spawn(command, spawnArgs, {
|
|
28
44
|
shell: isWindows, // Use shell on Windows to handle .cmd files
|
|
29
45
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
30
46
|
});
|
|
@@ -34,7 +34,7 @@ export class FileStorageProvider<T> implements MediaStorageProvider<T> {
|
|
|
34
34
|
// media.forEach(m => {
|
|
35
35
|
// });
|
|
36
36
|
for (const m of media) {
|
|
37
|
-
m['_full_url'] = `${this.settingService.getConfigValue<SolidCoreSetting>("baseUrl")}/${this.getFullFilePath(m.relativeUri)}`;
|
|
37
|
+
m['_full_url'] = `${this.settingService.getConfigValue<SolidCoreSetting>("baseUrl")}/${await this.getFullFilePath(m.relativeUri)}`;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
|