libdragon 12.0.1 → 12.0.2
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/modules/actions/exec.js +17 -15
- package/modules/actions/start.js +6 -14
- package/modules/helpers.js +6 -0
- package/modules/project-info.js +1 -1
- package/modules/utils.js +2 -11
- package/package.json +1 -1
package/modules/actions/exec.js
CHANGED
|
@@ -66,22 +66,24 @@ const exec = async (info) => {
|
|
|
66
66
|
const stdin = new PassThrough();
|
|
67
67
|
|
|
68
68
|
/** @type {string[]} */
|
|
69
|
-
const paramsWithConvertedPaths =
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
const paramsWithConvertedPaths = (
|
|
70
|
+
await Promise.all(
|
|
71
|
+
parameters.map(async (item) => {
|
|
72
|
+
if (item.startsWith('-')) {
|
|
73
|
+
return item;
|
|
74
|
+
}
|
|
75
|
+
if (
|
|
76
|
+
item.includes(path.sep) &&
|
|
77
|
+
((await fileExists(item)) || (await dirExists(item)))
|
|
78
|
+
) {
|
|
79
|
+
return toPosixPath(
|
|
80
|
+
path.isAbsolute(item) ? path.relative(process.cwd(), item) : item
|
|
81
|
+
);
|
|
82
|
+
}
|
|
72
83
|
return item;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
((await fileExists(item)) || (await dirExists(item)))
|
|
77
|
-
) {
|
|
78
|
-
return toPosixPath(
|
|
79
|
-
path.isAbsolute(item) ? path.relative(process.cwd(), item) : item
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
return item;
|
|
83
|
-
})
|
|
84
|
-
);
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
).map((param) => `"${param}"`);
|
|
85
87
|
|
|
86
88
|
/**
|
|
87
89
|
*
|
package/modules/actions/start.js
CHANGED
|
@@ -34,12 +34,13 @@ const initContainer = async (libdragonInfo) => {
|
|
|
34
34
|
'run',
|
|
35
35
|
'-d', // Detached
|
|
36
36
|
'--mount',
|
|
37
|
-
'type=bind,source=' +
|
|
37
|
+
'"type=bind,source=' +
|
|
38
38
|
libdragonInfo.root +
|
|
39
39
|
',target=' +
|
|
40
|
-
CONTAINER_TARGET_PATH
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
CONTAINER_TARGET_PATH +
|
|
41
|
+
'"', // Mount files
|
|
42
|
+
'"-w=' + CONTAINER_TARGET_PATH + '"', // Set working directory
|
|
43
|
+
'"' + libdragonInfo.imageName + '"',
|
|
43
44
|
'tail',
|
|
44
45
|
'-f',
|
|
45
46
|
'/dev/null',
|
|
@@ -58,16 +59,7 @@ const initContainer = async (libdragonInfo) => {
|
|
|
58
59
|
'-R',
|
|
59
60
|
`${uid >= 0 ? uid : ''}:${gid >= 0 ? gid : ''}`,
|
|
60
61
|
'/n64_toolchain',
|
|
61
|
-
]
|
|
62
|
-
{
|
|
63
|
-
userCommand: false,
|
|
64
|
-
inheritStdin: true,
|
|
65
|
-
inheritStdout: false,
|
|
66
|
-
inheritStderr: false,
|
|
67
|
-
spawnOptions: {
|
|
68
|
-
shell: true,
|
|
69
|
-
},
|
|
70
|
-
}
|
|
62
|
+
]
|
|
71
63
|
);
|
|
72
64
|
} catch (e) {
|
|
73
65
|
// Dispose the invalid container, clean and exit
|
package/modules/helpers.js
CHANGED
|
@@ -188,6 +188,12 @@ function spawnProcess(
|
|
|
188
188
|
// Prevent the annoying docker "What's next?" message. It messes up everything.
|
|
189
189
|
DOCKER_CLI_HINTS: 'false',
|
|
190
190
|
},
|
|
191
|
+
// On macos, we need to run the command in a shell for some docker commands
|
|
192
|
+
// to work properly. The ones with paths in them probably not working on
|
|
193
|
+
// macOS. No need to do this on Windows, as it'd now require additional
|
|
194
|
+
// escaping for the paths.
|
|
195
|
+
// shell: process.platform === 'darwin',
|
|
196
|
+
shell: true,
|
|
191
197
|
...spawnOptions,
|
|
192
198
|
});
|
|
193
199
|
|
package/modules/project-info.js
CHANGED
package/modules/utils.js
CHANGED
|
@@ -40,16 +40,7 @@ const installDependencies = async (libdragonInfo) => {
|
|
|
40
40
|
CONTAINER_TARGET_PATH + '/' + libdragonInfo.vendorDirectory,
|
|
41
41
|
...dockerHostUserParams(libdragonInfo),
|
|
42
42
|
],
|
|
43
|
-
['/bin/bash', './build.sh']
|
|
44
|
-
{
|
|
45
|
-
userCommand: false,
|
|
46
|
-
inheritStdin: true,
|
|
47
|
-
inheritStdout: false,
|
|
48
|
-
inheritStderr: false,
|
|
49
|
-
spawnOptions: {
|
|
50
|
-
shell: true,
|
|
51
|
-
},
|
|
52
|
-
}
|
|
43
|
+
['/bin/bash', './build.sh']
|
|
53
44
|
);
|
|
54
45
|
};
|
|
55
46
|
|
|
@@ -142,7 +133,7 @@ async function runGit(libdragonInfo, params, options = {}) {
|
|
|
142
133
|
|
|
143
134
|
return await spawnProcess(
|
|
144
135
|
'git',
|
|
145
|
-
['-C', libdragonInfo.root, ...params],
|
|
136
|
+
['-C', '"' + libdragonInfo.root + '"', ...params],
|
|
146
137
|
// Windows git is breaking the TTY somehow - disable TTY for now
|
|
147
138
|
// We are not able to display progress for the initial clone b/c of this
|
|
148
139
|
// Enable progress otherwise.
|