@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.cjs CHANGED
@@ -1732,8 +1732,8 @@ var DEV_PIN_INTEGRITY = "sha512-development-build-not-a-published-release";
1732
1732
  var DEV_PIN_VERSION = "0.0.0-dev";
1733
1733
  var BUNDLED_ENGINE_PIN = {
1734
1734
  package: import_core8.ENGINE_PACKAGE,
1735
- version: "0.16.0",
1736
- integrity: "sha512-DSA07wrSown70tU/9ix9yozJihsQjHFPN3/iXLiH6sS6LYT+/PWBFmVI6C2tH/qaUL2GGh4mgRHL8LGM749C8Q=="
1735
+ version: "0.16.1",
1736
+ integrity: "sha512-ME0JXN5q2DWDPicd/Fvi22PaX51PgS+zdY8mpVwlf9fM3gqLzSJsYJEAd3h4nOYph46kSuE6gH9w/UvwDVmmWw=="
1737
1737
  };
1738
1738
  function assertReleasePin(pin) {
1739
1739
  if (pin.integrity === DEV_PIN_INTEGRITY || pin.version === DEV_PIN_VERSION) {
@@ -1961,6 +1961,38 @@ async function runLauncher(options) {
1961
1961
  return 1;
1962
1962
  }
1963
1963
  }
1964
+ function isBehind(own, pinned) {
1965
+ const parse = (text4) => {
1966
+ const parts = text4.split(".").map((part) => Number(part));
1967
+ return parts.length === 3 && parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : void 0;
1968
+ };
1969
+ const a = parse(own);
1970
+ const b = parse(pinned);
1971
+ if (a === void 0 || b === void 0) {
1972
+ return void 0;
1973
+ }
1974
+ for (const [index, part] of a.entries()) {
1975
+ const other = b[index];
1976
+ if (part !== other) {
1977
+ return part < other;
1978
+ }
1979
+ }
1980
+ return false;
1981
+ }
1982
+ function reportLauncherVersion(options, pinned) {
1983
+ let own;
1984
+ try {
1985
+ own = options.bundledEngine().version;
1986
+ } catch {
1987
+ return;
1988
+ }
1989
+ if (isBehind(own, pinned) !== true) {
1990
+ return;
1991
+ }
1992
+ options.io.out(
1993
+ `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}\`.`
1994
+ );
1995
+ }
1964
1996
  async function launch(options) {
1965
1997
  const { argv, cwd, env, io: io2 } = options;
1966
1998
  const { noDownload, forwarded } = splitLauncherFlags(argv);
@@ -2004,6 +2036,7 @@ async function launch(options) {
2004
2036
  const manifest = readManifest(project.manifestFile, home, argv);
2005
2037
  if (first !== void 0 && VERSION_FLAGS.has(first)) {
2006
2038
  io2.out(`penv ${manifest.engine.version}`);
2039
+ reportLauncherVersion(options, manifest.engine.version);
2007
2040
  return 0;
2008
2041
  }
2009
2042
  if (first === UPGRADE) {