@getmonoceros/workbench 1.16.2 → 1.17.0
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/bin.js +24 -5
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2191,6 +2191,12 @@ function normalizeOptions(opts) {
|
|
|
2191
2191
|
function needsCompose(opts) {
|
|
2192
2192
|
return opts.services.length > 0;
|
|
2193
2193
|
}
|
|
2194
|
+
function featuresSourceRoot() {
|
|
2195
|
+
const override2 = process.env.MONOCEROS_FEATURES_DIR_OVERRIDE?.trim();
|
|
2196
|
+
if (override2 && override2.length > 0) return override2;
|
|
2197
|
+
const checkout = workbenchCheckoutRoot();
|
|
2198
|
+
return checkout ? path8.join(checkout, "images", "features") : null;
|
|
2199
|
+
}
|
|
2194
2200
|
function resolveFeatures(opts) {
|
|
2195
2201
|
const resolved = [];
|
|
2196
2202
|
for (const langSpec of opts.languages) {
|
|
@@ -2223,8 +2229,8 @@ function resolveFeatures(opts) {
|
|
|
2223
2229
|
const match = matchMonocerosFeature(rawRef);
|
|
2224
2230
|
if (match) {
|
|
2225
2231
|
const name = match.name;
|
|
2226
|
-
const
|
|
2227
|
-
const localSourceDir =
|
|
2232
|
+
const sourceRoot = featuresSourceRoot();
|
|
2233
|
+
const localSourceDir = sourceRoot ? path8.join(sourceRoot, name) : null;
|
|
2228
2234
|
if (localSourceDir && existsSync5(localSourceDir)) {
|
|
2229
2235
|
const { paths: paths2, files: files2 } = readPersistentHomeEntries(localSourceDir);
|
|
2230
2236
|
resolved.push({
|
|
@@ -6287,7 +6293,7 @@ var CLI_VERSION;
|
|
|
6287
6293
|
var init_version = __esm({
|
|
6288
6294
|
"src/version.ts"() {
|
|
6289
6295
|
"use strict";
|
|
6290
|
-
CLI_VERSION = true ? "1.
|
|
6296
|
+
CLI_VERSION = true ? "1.17.0" : "dev";
|
|
6291
6297
|
}
|
|
6292
6298
|
});
|
|
6293
6299
|
|
|
@@ -8605,13 +8611,21 @@ async function runInContainer(opts) {
|
|
|
8605
8611
|
{ quiet: true }
|
|
8606
8612
|
);
|
|
8607
8613
|
if (upCode !== 0) return upCode;
|
|
8614
|
+
const innerExec = opts.cwd ? [
|
|
8615
|
+
"bash",
|
|
8616
|
+
"-lc",
|
|
8617
|
+
'cd -- "$1" && shift && exec "$@"',
|
|
8618
|
+
"bash",
|
|
8619
|
+
opts.cwd,
|
|
8620
|
+
...opts.command
|
|
8621
|
+
] : opts.command;
|
|
8608
8622
|
return spawnFn(
|
|
8609
8623
|
[
|
|
8610
8624
|
"exec",
|
|
8611
8625
|
"--workspace-folder",
|
|
8612
8626
|
opts.root,
|
|
8613
8627
|
"--mount-workspace-git-root=false",
|
|
8614
|
-
...
|
|
8628
|
+
...innerExec
|
|
8615
8629
|
],
|
|
8616
8630
|
opts.root,
|
|
8617
8631
|
{ interactive: true }
|
|
@@ -8646,6 +8660,10 @@ var init_run2 = __esm({
|
|
|
8646
8660
|
type: "positional",
|
|
8647
8661
|
description: "Container name (yml in $MONOCEROS_HOME/container-configs/).",
|
|
8648
8662
|
required: true
|
|
8663
|
+
},
|
|
8664
|
+
in: {
|
|
8665
|
+
type: "string",
|
|
8666
|
+
description: "Run the inner command in this directory inside the container (relative to the workspace folder, or absolute). The directory must already exist."
|
|
8649
8667
|
}
|
|
8650
8668
|
},
|
|
8651
8669
|
async run({ args }) {
|
|
@@ -8659,7 +8677,8 @@ var init_run2 = __esm({
|
|
|
8659
8677
|
try {
|
|
8660
8678
|
const exitCode = await runInContainer({
|
|
8661
8679
|
root: containerDir(args.name),
|
|
8662
|
-
command
|
|
8680
|
+
command,
|
|
8681
|
+
...args.in ? { cwd: args.in } : {}
|
|
8663
8682
|
});
|
|
8664
8683
|
process.exit(exitCode);
|
|
8665
8684
|
} catch (err) {
|