Skip to content

Commit

Permalink
Read from VERSION file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jhheider authored and mxcl committed Dec 2, 2022
1 parent e53d7a5 commit 49cb0d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hooks/useVirtualEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ export default async function useVirtualEnv(opts?: { cwd: Path }): Promise<Virtu

if (files.length < 1) throw new TeaError("not-found: virtual-env", ctx)

const { file, version } = files.find(x => x.file.basename() == "README.md") ?? files[0]
const { file, version: req_version } = files.find(x => x.file.basename() == "README.md") ?? files[0]

const version_file = srcroot.join("VERSION").isFile()

const version = version_file ? semver.parse(await version_file.read()) ?? req_version : req_version

const pkgs = files.flatMap(x => x.pkgs)

//TODO magic deps should not conflict with requirements files deps
Expand Down

0 comments on commit 49cb0d6

Please sign in to comment.