@penvhq/launcher 0.9.3 → 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/bin.cjs CHANGED
@@ -1217,8 +1217,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1217
1217
  var DEV_PIN_VERSION = "0.0.0-dev";
1218
1218
  var BUNDLED_ENGINE_PIN = {
1219
1219
  package: import_core7.ENGINE_PACKAGE,
1220
- version: "0.9.3",
1221
- integrity: "sha512-9ZPRFCovPXXFYxT7SWJth8IX1Rgu/FXl8+60Pn8MBu5UYG4m4l0fBi1aFwnxVVcriAnFmxNtNG4hwn1a1IliWw=="
1220
+ version: "0.9.4",
1221
+ integrity: "sha512-XnG+KlEAZyUaaKUfANPiyhY1dfYZ9KgnkF2R+5A0OskRgfYPSpBRN0i1UPtq8RnwMJaPxfSNDNdqfiiESz6kRw=="
1222
1222
  };
1223
1223
  function assertReleasePin(pin) {
1224
1224
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -1358,7 +1358,7 @@ async function launch(options) {
1358
1358
  return delegate(options, options.bundledEngine(), forwarded, home, cwd);
1359
1359
  }
1360
1360
  if (ADOPTS.has(first)) {
1361
- return adopt(options, forwarded, home, cwd);
1361
+ return adopt(options, forwarded, home, cwd, noDownload);
1362
1362
  }
1363
1363
  throw new NoProjectError(cwd);
1364
1364
  }
@@ -1382,7 +1382,7 @@ async function launch(options) {
1382
1382
  const engine = engineAt(engineDir, enginePin.name, enginePin.version);
1383
1383
  return delegate(options, engine, forwarded, home, cwd);
1384
1384
  }
1385
- async function adopt(options, forwarded, home, cwd) {
1385
+ async function adopt(options, forwarded, home, cwd, noDownload) {
1386
1386
  const engine = options.bundledEngine();
1387
1387
  const code = await delegate(options, engine, forwarded, home, cwd);
1388
1388
  if (code !== 0) {
@@ -1402,8 +1402,26 @@ async function adopt(options, forwarded, home, cwd) {
1402
1402
  (0, import_core9.serializeManifest)({ format: import_core9.MANIFEST_FORMAT, engine: pin, extensions: {} })
1403
1403
  );
1404
1404
  options.io.out(`\u2713 ${import_core9.MANIFEST_PATH} pins ${pin.package} ${pin.version}`);
1405
+ await ensureAdoptedEngine(
1406
+ options,
1407
+ { name: pin.package, version: pin.version, integrity: pin.integrity },
1408
+ home,
1409
+ noDownload
1410
+ );
1405
1411
  return 0;
1406
1412
  }
1413
+ async function ensureAdoptedEngine(options, pin, home, noDownload) {
1414
+ try {
1415
+ await ensure(options, "engines", pin, home, noDownload);
1416
+ } catch (error) {
1417
+ if (!(error instanceof PackageMissingError || error instanceof InstallDeclinedError)) {
1418
+ report(error, options.io);
1419
+ }
1420
+ options.io.out(
1421
+ `\u2192 Run \`${INSTALL_COMMAND}\` to install ${pin.name} ${pin.version} before your first \`penv run\`.`
1422
+ );
1423
+ }
1424
+ }
1407
1425
  async function ensure(options, kind, pin, home, noDownload) {
1408
1426
  const { io: io2, env, fetcher } = options;
1409
1427
  const { dir, state } = inspectInstall(home, kind, pin);