Skip to content

Commit

Permalink
Use APALACHE_DIST if set
Browse files Browse the repository at this point in the history
  • Loading branch information
thpani committed Aug 1, 2023
1 parent 06fc66a commit e105a6b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions quint/src/quintVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,8 @@ function err<A>(explanation: string, errors: ErrorMessage[] = [], traces?: ItfTr
}

function findApalacheDistribution(): VerifyResult<ApalacheDist> {
if (!process.env.APALACHE_DIST) {
// TODO: fetch release if APALACHE_DIST is not configured
// See https://github.com/informalsystems/quint/issues/701
return err('APALACHE_DIST enviroment variable is not set.')
}

const dist = path.isAbsolute(process.env.APALACHE_DIST)
? process.env.APALACHE_DIST
const dist = path.isAbsolute(process.env.APALACHE_DIST!)
? process.env.APALACHE_DIST!
: path.join(process.cwd(), process.env.APALACHE_DIST!)

if (!fs.existsSync(dist)) {
Expand Down Expand Up @@ -340,9 +334,7 @@ async function connect(cmdExecutor: AsyncCmdExecutor): Promise<VerifyResult<Apal
*/
export async function verify(config: any): Promise<VerifyResult<void>> {
// Attempt to load proto definition from Apalache distribution, else via reflection
const protoDefResult = findApalacheDistribution()
.chain(dist => loadProtoDefViaDistribution(dist))
.or(await loadProtoDefViaReflection())
const protoDefResult = process.env.APALACHE_DIST ? findApalacheDistribution().chain(dist => loadProtoDefViaDistribution(dist)) : await loadProtoDefViaReflection()
const connectionResult = await protoDefResult.chain(loadGrpcClient).asyncChain(connect)
return connectionResult.asyncChain(conn => conn.check(config))
}

0 comments on commit e105a6b

Please sign in to comment.