Skip to content

Commit

Permalink
patch default version
Browse files Browse the repository at this point in the history
  • Loading branch information
UrielCh committed Apr 15, 2024
1 parent 9e816c8 commit d42c5ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/OpenCVBuildEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,16 @@ export default class OpenCVBuildEnv implements OpenCVBuildEnvParamsBool, OpenCVB
}


private getExpectedVersion(): string {
private getExpectedVersion(defaultVersion?: string): string {
if (this.no_autobuild) {
return '0.0.0';
}
const opencvVersion = this.resolveValue(ALLARGS.version);
if (opencvVersion)
return opencvVersion;
return '0.0.0'; //DEFAULT_OPENCV_VERSION;
}
return defaultVersion || "";
// return '0.0.0'; //DEFAULT_OPENCV_VERSION;
}

// private getExpectedBuildWithCuda(): boolean {
// return !!this.resolveValue(ALLARGS.cuda);
Expand Down Expand Up @@ -235,7 +236,7 @@ export default class OpenCVBuildEnv implements OpenCVBuildEnvParamsBool, OpenCVB
if (!builds.length) {
throw Error(`No build found in ${this.rootDir} you should launch opencv-build-npm once`);
}
const expVer = this.getExpectedVersion();
const expVer = this.getExpectedVersion("0.0.0");
/**
* try to match the expected version
*/
Expand Down Expand Up @@ -334,7 +335,7 @@ export default class OpenCVBuildEnv implements OpenCVBuildEnvParamsBool, OpenCVB
const changes = OpenCVBuildEnv.autoLocatePrebuild();
OpenCVBuildEnv.log('info', 'init', changes.summery.join('\n'));
} else {
this.opencvVersion = this.getExpectedVersion();
this.opencvVersion = this.getExpectedVersion("4.9.0");
OpenCVBuildEnv.log('info', 'init', `using openCV verison ${formatNumber(this.opencvVersion)}`);

if (process.env.INIT_CWD) {
Expand Down

0 comments on commit d42c5ce

Please sign in to comment.