import { BaseCoreFilesUpdater } from "./BaseCoreFilesUpdater" ; import * as semver from "semver" ; import { CoreFilesUpdater_3_0 } from "./coreFilesUpdaters/CoreFilesUpdater_3_0" ; import { CoreFilesUpdaterNop } from "./coreFilesUpdaters/CoreFilesUpdaterNop" ; import { CoreFilesUpdater_2 } from "./coreFilesUpdaters/CoreFilesUpdater_2" ; import { CoreFilesUpdater_3_2 } from "./coreFilesUpdaters/CoreFilesUpdater_3_2" ; export class CoreFilesUpdaterFactory { public static createCoreFilesUpdater ( currentVersion ) { if ( semver . lt ( currentVersion , "3.0.0" ) ) { return new CoreFilesUpdater_2 ( currentVersion ) ; } if ( semver . lt ( currentVersion , "3.2.0" ) ) { return new CoreFilesUpdater_3_2 ( currentVersion ) ; } if ( semver . major ( currentVersion ) === 3 ) { return new CoreFilesUpdater_3_0 ( currentVersion ) ; } return undefined ; } }