From d566c52045cba13567a463b1b1c455bf057b2720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Thu, 17 Apr 2025 10:08:20 +0200 Subject: [PATCH] feat: version env. variable support --- README.md | 2 +- src/utils/config-sources.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fbc17fd..6485eed 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Codex Factory [![Tests](https://github.com/codex-storage/codex-factory/actions/workflows/test.yaml/badge.svg)](https://github.com/codex-storage/codex-factory/actions/workflows/test.yaml) -[![](https://img.shields.io/badge/made%20by-Swarm-blue.svg?style=flat-square)](https://swarm.ethereum.org/) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) ![](https://img.shields.io/badge/npm-%3E%3D10.0.0-orange.svg?style=flat-square) @@ -59,6 +58,7 @@ For more details see the `--help` page of the CLI and its commands. You can omit the Codex version argument when running `codex-factory start` command if you specify it in one of the expected places: + - `CODEX_FACTORY_VERSION` env. variable - `package.json` placed in current working directory (cwd) under the `engines.codex` property. - `.codexfactory.json` placed in current working directory (cwd) with property `version`. diff --git a/src/utils/config-sources.ts b/src/utils/config-sources.ts index 7512608..4537f02 100644 --- a/src/utils/config-sources.ts +++ b/src/utils/config-sources.ts @@ -55,6 +55,10 @@ async function searchCodexFactory(): Promise { } export async function findCodexVersion(): Promise { + if (process.env.CODEX_FACTORY_VERSION) { + return process.env.CODEX_FACTORY_VERSION + } + const packageJson = await searchPackageJson() if (packageJson) {