libdragon 12.0.3 → 12.0.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/modules/actions/start.js +5 -11
- package/modules/helpers.js +5 -12
- package/modules/npm-utils.js +10 -1
- package/modules/project-info.js +1 -1
- package/modules/utils.js +2 -7
- package/package.json +1 -1
package/modules/actions/start.js
CHANGED
|
@@ -34,13 +34,12 @@ const initContainer = async (libdragonInfo) => {
|
|
|
34
34
|
'run',
|
|
35
35
|
'-d', // Detached
|
|
36
36
|
'--mount',
|
|
37
|
-
'
|
|
37
|
+
'type=bind,source=' +
|
|
38
38
|
libdragonInfo.root +
|
|
39
39
|
',target=' +
|
|
40
|
-
CONTAINER_TARGET_PATH
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'"' + libdragonInfo.imageName + '"',
|
|
40
|
+
CONTAINER_TARGET_PATH, // Mount files
|
|
41
|
+
'-w=' + CONTAINER_TARGET_PATH, // Set working directory
|
|
42
|
+
libdragonInfo.imageName,
|
|
44
43
|
'tail',
|
|
45
44
|
'-f',
|
|
46
45
|
'/dev/null',
|
|
@@ -59,12 +58,7 @@ const initContainer = async (libdragonInfo) => {
|
|
|
59
58
|
'-R',
|
|
60
59
|
`${uid >= 0 ? uid : ''}:${gid >= 0 ? gid : ''}`,
|
|
61
60
|
'/n64_toolchain',
|
|
62
|
-
]
|
|
63
|
-
{
|
|
64
|
-
spawnOptions: {
|
|
65
|
-
shell: true,
|
|
66
|
-
},
|
|
67
|
-
}
|
|
61
|
+
]
|
|
68
62
|
);
|
|
69
63
|
} catch (e) {
|
|
70
64
|
// Dispose the invalid container, clean and exit
|
package/modules/helpers.js
CHANGED
|
@@ -124,12 +124,11 @@ async function dirExists(path) {
|
|
|
124
124
|
* }} SpawnOptions
|
|
125
125
|
*/
|
|
126
126
|
|
|
127
|
+
// A simple Promise wrapper for child_process.spawn. Return the err/out streams
|
|
128
|
+
// from the process by default. Specify inheritStdout / inheritStderr to disable
|
|
129
|
+
// this and inherit the parent process's stream, passing through the TTY if any.
|
|
127
130
|
/**
|
|
128
|
-
*
|
|
129
|
-
* from the process by default. Specify inheritStdout / inheritStderr to disable
|
|
130
|
-
* this and inherit the parent process's stream, passing through the TTY if any.
|
|
131
|
-
* Runs everything in a shell, so be careful with user input. By default, we get
|
|
132
|
-
* the input from user but this is the whole idea of most of the logic here.
|
|
131
|
+
*
|
|
133
132
|
* @param {string} cmd
|
|
134
133
|
* @param {string[]} params
|
|
135
134
|
* @param {SpawnOptions} options
|
|
@@ -185,15 +184,10 @@ function spawnProcess(
|
|
|
185
184
|
enableErrorTTY ? 'inherit' : 'pipe',
|
|
186
185
|
],
|
|
187
186
|
env: {
|
|
187
|
+
...process.env,
|
|
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,
|
|
197
191
|
...spawnOptions,
|
|
198
192
|
});
|
|
199
193
|
|
|
@@ -320,7 +314,6 @@ const dockerExec = /** @type {DockerExec} */ (
|
|
|
320
314
|
...options,
|
|
321
315
|
spawnOptions: {
|
|
322
316
|
cwd: workDir,
|
|
323
|
-
shell: false,
|
|
324
317
|
...options?.spawnOptions,
|
|
325
318
|
},
|
|
326
319
|
});
|
package/modules/npm-utils.js
CHANGED
|
@@ -21,7 +21,16 @@ async function findNPMRoot() {
|
|
|
21
21
|
function runNPM(params) {
|
|
22
22
|
return spawnProcess(
|
|
23
23
|
/^win/.test(process.platform) ? 'npm.cmd' : 'npm',
|
|
24
|
-
params
|
|
24
|
+
params,
|
|
25
|
+
{
|
|
26
|
+
userCommand: false,
|
|
27
|
+
inheritStdin: true,
|
|
28
|
+
inheritStdout: false,
|
|
29
|
+
inheritStderr: false,
|
|
30
|
+
spawnOptions: {
|
|
31
|
+
shell: true,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
25
34
|
);
|
|
26
35
|
}
|
|
27
36
|
module.exports = {
|
package/modules/project-info.js
CHANGED
package/modules/utils.js
CHANGED
|
@@ -40,12 +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
|
-
spawnOptions: {
|
|
46
|
-
shell: true,
|
|
47
|
-
},
|
|
48
|
-
}
|
|
43
|
+
['/bin/bash', './build.sh']
|
|
49
44
|
);
|
|
50
45
|
};
|
|
51
46
|
|
|
@@ -138,7 +133,7 @@ async function runGit(libdragonInfo, params, options = {}) {
|
|
|
138
133
|
|
|
139
134
|
return await spawnProcess(
|
|
140
135
|
'git',
|
|
141
|
-
['-C',
|
|
136
|
+
['-C', libdragonInfo.root, ...params],
|
|
142
137
|
// Windows git is breaking the TTY somehow - disable TTY for now
|
|
143
138
|
// We are not able to display progress for the initial clone b/c of this
|
|
144
139
|
// Enable progress otherwise.
|