@penvhq/launcher 0.16.0 → 0.16.1

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 CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  httpFetcher,
6
6
  nodeSpawner,
7
7
  runLauncher
8
- } from "./chunk-HQTTS5BH.js";
8
+ } from "./chunk-JBOUWGKF.js";
9
9
 
10
10
  // src/bin.ts
11
11
  function readLine() {
@@ -1696,8 +1696,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1696
1696
  var DEV_PIN_VERSION = "0.0.0-dev";
1697
1697
  var BUNDLED_ENGINE_PIN = {
1698
1698
  package: ENGINE_PACKAGE3,
1699
- version: "0.16.0",
1700
- integrity: "sha512-DSA07wrSown70tU/9ix9yozJihsQjHFPN3/iXLiH6sS6LYT+/PWBFmVI6C2tH/qaUL2GGh4mgRHL8LGM749C8Q=="
1699
+ version: "0.16.1",
1700
+ integrity: "sha512-ME0JXN5q2DWDPicd/Fvi22PaX51PgS+zdY8mpVwlf9fM3gqLzSJsYJEAd3h4nOYph46kSuE6gH9w/UvwDVmmWw=="
1701
1701
  };
1702
1702
  function assertReleasePin(pin) {
1703
1703
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -1995,6 +1995,38 @@ async function runLauncher(options) {
1995
1995
  return 1;
1996
1996
  }
1997
1997
  }
1998
+ function isBehind(own, pinned) {
1999
+ const parse = (text4) => {
2000
+ const parts = text4.split(".").map((part) => Number(part));
2001
+ return parts.length === 3 && parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : void 0;
2002
+ };
2003
+ const a = parse(own);
2004
+ const b = parse(pinned);
2005
+ if (a === void 0 || b === void 0) {
2006
+ return void 0;
2007
+ }
2008
+ for (const [index, part] of a.entries()) {
2009
+ const other = b[index];
2010
+ if (part !== other) {
2011
+ return part < other;
2012
+ }
2013
+ }
2014
+ return false;
2015
+ }
2016
+ function reportLauncherVersion(options, pinned) {
2017
+ let own;
2018
+ try {
2019
+ own = options.bundledEngine().version;
2020
+ } catch {
2021
+ return;
2022
+ }
2023
+ if (isBehind(own, pinned) !== true) {
2024
+ return;
2025
+ }
2026
+ options.io.out(
2027
+ `launcher ${own} \u2014 \`penv add\` and \`penv upgrade\` run from the launcher, not the pinned engine. Move it with \`npm install -g @penvhq/launcher@${pinned}\`.`
2028
+ );
2029
+ }
1998
2030
  async function launch(options) {
1999
2031
  const { argv, cwd, env, io } = options;
2000
2032
  const { noDownload, forwarded } = splitLauncherFlags(argv);
@@ -2038,6 +2070,7 @@ async function launch(options) {
2038
2070
  const manifest = readManifest(project.manifestFile, home, argv);
2039
2071
  if (first !== void 0 && VERSION_FLAGS.has(first)) {
2040
2072
  io.out(`penv ${manifest.engine.version}`);
2073
+ reportLauncherVersion(options, manifest.engine.version);
2041
2074
  return 0;
2042
2075
  }
2043
2076
  if (first === UPGRADE) {
@@ -2259,4 +2292,4 @@ export {
2259
2292
  upgrade,
2260
2293
  runLauncher
2261
2294
  };
2262
- //# sourceMappingURL=chunk-HQTTS5BH.js.map
2295
+ //# sourceMappingURL=chunk-JBOUWGKF.js.map