'use strict';

const appDefault = require('./app-default');
const appEnvTarget = require('./app-env-target');
const appCommon = require('./app-common');

module.exports.getNewVersion = (project, isSnapshot, isSupportBranch, envTarget) => {
  return Promise.resolve()
    .then(() => {
      if (envTarget) {
        return appEnvTarget.getNewVersion(project, envTarget);
      } else {
        return appDefault.getNewVersion(project, isSnapshot, isSupportBranch);
      }
    })
    .catch((e) => {
      throw e;
    });
};

module.exports.updatePackageVersion = appCommon.updatePackageVersion;

module.exports.getCurrentVersion = appCommon.getCurrentVersion;
