@penvhq/launcher 0.9.2 → 0.9.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/dist/index.cjs CHANGED
@@ -1304,8 +1304,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1304
1304
  var DEV_PIN_VERSION = "0.0.0-dev";
1305
1305
  var BUNDLED_ENGINE_PIN = {
1306
1306
  package: import_core7.ENGINE_PACKAGE,
1307
- version: "0.9.2",
1308
- integrity: "sha512-fKiZup3eu/9SqhZ9DipjAHxzwrJdZNyfmO/JokB0lY5mYfGTCDFJAdmOYYOacqZpV0B7iP6gOEd9hRZSA5pzDQ=="
1307
+ version: "0.9.4",
1308
+ integrity: "sha512-XnG+KlEAZyUaaKUfANPiyhY1dfYZ9KgnkF2R+5A0OskRgfYPSpBRN0i1UPtq8RnwMJaPxfSNDNdqfiiESz6kRw=="
1309
1309
  };
1310
1310
  function assertReleasePin(pin) {
1311
1311
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -1445,7 +1445,7 @@ async function launch(options) {
1445
1445
  return delegate(options, options.bundledEngine(), forwarded, home, cwd);
1446
1446
  }
1447
1447
  if (ADOPTS.has(first)) {
1448
- return adopt(options, forwarded, home, cwd);
1448
+ return adopt(options, forwarded, home, cwd, noDownload);
1449
1449
  }
1450
1450
  throw new NoProjectError(cwd);
1451
1451
  }
@@ -1469,7 +1469,7 @@ async function launch(options) {
1469
1469
  const engine = engineAt(engineDir, enginePin.name, enginePin.version);
1470
1470
  return delegate(options, engine, forwarded, home, cwd);
1471
1471
  }
1472
- async function adopt(options, forwarded, home, cwd) {
1472
+ async function adopt(options, forwarded, home, cwd, noDownload) {
1473
1473
  const engine = options.bundledEngine();
1474
1474
  const code = await delegate(options, engine, forwarded, home, cwd);
1475
1475
  if (code !== 0) {
@@ -1489,8 +1489,26 @@ async function adopt(options, forwarded, home, cwd) {
1489
1489
  (0, import_core9.serializeManifest)({ format: import_core9.MANIFEST_FORMAT, engine: pin, extensions: {} })
1490
1490
  );
1491
1491
  options.io.out(`\u2713 ${import_core9.MANIFEST_PATH} pins ${pin.package} ${pin.version}`);
1492
+ await ensureAdoptedEngine(
1493
+ options,
1494
+ { name: pin.package, version: pin.version, integrity: pin.integrity },
1495
+ home,
1496
+ noDownload
1497
+ );
1492
1498
  return 0;
1493
1499
  }
1500
+ async function ensureAdoptedEngine(options, pin, home, noDownload) {
1501
+ try {
1502
+ await ensure(options, "engines", pin, home, noDownload);
1503
+ } catch (error) {
1504
+ if (!(error instanceof PackageMissingError || error instanceof InstallDeclinedError)) {
1505
+ report(error, options.io);
1506
+ }
1507
+ options.io.out(
1508
+ `\u2192 Run \`${INSTALL_COMMAND}\` to install ${pin.name} ${pin.version} before your first \`penv run\`.`
1509
+ );
1510
+ }
1511
+ }
1494
1512
  async function ensure(options, kind, pin, home, noDownload) {
1495
1513
  const { io, env, fetcher } = options;
1496
1514
  const { dir, state } = inspectInstall(home, kind, pin);