How to use the azure-pipelines-tool-lib/tool.isExplicitVersion function in azure-pipelines-tool-lib

To help you get started, we’ve selected a few azure-pipelines-tool-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rdagumampan / yuniql / yuniql-azure-pipelines / src / run / runyuniql.ts View on Github external
console.log('yuniql/input_version: ' + versionSpec);
        console.log('yuniql/input_workspacePath: ' + workspacePath);
        console.log('yuniql/input_connectionString: ' + connectionString);
        console.log('yuniql/input_targetPlatform: ' + targetPlatform);
        console.log('yuniql/input_autoCreateDatabase: ' + autoCreateDatabase);
        console.log('yuniql/input_targetVersion: ' + targetVersion);
        console.log('yuniql/input_tokenKeyValuePair: ' + tokenKeyValuePair);
        console.log('yuniql/input_delimiter: ' + delimiter);
        console.log('yuniql/input_additionalArguments: ' + additionalArguments);

        console.log('yuniql/var_osPlat: ' + osPlat);
        console.log('yuniql/var_osArch: ' + osArch);

        //picksup the version downloaded from install task
        let versionLocation: string = '';
        if (toolLib.isExplicitVersion(versionSpec)) {
            versionLocation = versionSpec;
        } else {
            //use v0.0.0 as placeholder for latest version
            versionLocation = 'v0.0.0'
        }

        if (osPlat == 'win32') {
            var yuniqlBasePath = path.join(toolLib.findLocalTool('yuniql', versionLocation));
            console.log('yuniql/var_yuniqlBasePath: ' + yuniqlBasePath);

            var yuniqlExecFilePath = path.join(yuniqlBasePath, 'yuniql.exe');
            console.log('yuniql/var_yuniqlExecFilePath: ' + yuniqlExecFilePath);

            //set the plugin path
            // var pluginsPath = path.join(yuniqlBasePath, '.plugins');
            // console.log('var_pluginsPath: ' + pluginsPath);
github rdagumampan / yuniql / yuniql-azure-pipelines / src / install / installer.ts View on Github external
export async function getYuniql(versionSpec: string, checkLatest: boolean) {
    try {
        console.log('yuniql/var_osPlat: ' + osPlat);
        console.log('yuniql/var_osArch: ' + osArch);

        // when version is explicit, we dont check the latest
        let version: string = '';
        if (toolLib.isExplicitVersion(versionSpec)) {
            checkLatest = false;
            console.log('yuniql/var_isExplicitVersion: true');
            console.log('yuniql/var_checkLatest: false');
        }

        // when version is explicit, we check the cache first
        let toolPath: string = '';
        if (!checkLatest) {
            toolPath = toolLib.findLocalTool('yuniql', versionSpec);
        }

        // when cached version doesnt exists, we download a fresh copy
        if (!toolPath) {
            //when version is explicit, use the version specified, else we acquire latest version
            if (toolLib.isExplicitVersion(versionSpec)) {
                version = versionSpec;
github microsoft / azure-devops-extension-tasks / BuildTasks / TfxInstaller / TfxInstaller.ts View on Github external
async function getTfx(versionSpec: string, checkLatest: boolean) {
    if (toolLib.isExplicitVersion(versionSpec)) {
        checkLatest = false; // check latest doesn't make sense when explicit version
    }

    let toolPath: string;
    if (!checkLatest) {
        toolPath = toolLib.findLocalTool('tfx', versionSpec);
    }

    if (!toolPath) {
        let version: string;
        if (toolLib.isExplicitVersion(versionSpec)) {
            version = versionSpec;
        }
        else {
            version = queryLatestMatch(versionSpec);
            if (!version) {
github microsoft / azure-pipelines-tasks / Tasks / DotNetCoreInstallerV1 / versioninstaller.ts View on Github external
public isVersionInstalled(version: string): boolean {
        if (!toolLib.isExplicitVersion(version)) {
            throw tl.loc("ExplicitVersionRequired", version);
        }

        var isInstalled: boolean = false;
        if (this.packageType == utils.Constants.sdk) {
            isInstalled = tl.exist(path.join(this.installationPath, utils.Constants.relativeSdkPath, version)) && tl.exist(path.join(this.installationPath, utils.Constants.relativeSdkPath, `${version}.complete`));
        }
        else {
            isInstalled = tl.exist(path.join(this.installationPath, utils.Constants.relativeRuntimePath, version)) && tl.exist(path.join(this.installationPath, utils.Constants.relativeRuntimePath, `${version}.complete`));
        }

        isInstalled ? console.log(tl.loc("VersionFoundInCache", version)) : console.log(tl.loc("VersionNotFoundInCache", version));
        return isInstalled;
    }
github microsoft / azure-pipelines-tasks / Tasks / UseDotNetV2 / versioninstaller.ts View on Github external
public isVersionInstalled(version: string): boolean {
        if (!toolLib.isExplicitVersion(version)) {
            throw tl.loc("ExplicitVersionRequired", version);
        }

        var isInstalled: boolean = false;
        if (this.packageType == utils.Constants.sdk) {
            isInstalled = tl.exist(path.join(this.installationPath, utils.Constants.relativeSdkPath, version)) && tl.exist(path.join(this.installationPath, utils.Constants.relativeSdkPath, `${version}.complete`));
        }
        else {
            isInstalled = tl.exist(path.join(this.installationPath, utils.Constants.relativeRuntimePath, version)) && tl.exist(path.join(this.installationPath, utils.Constants.relativeRuntimePath, `${version}.complete`));
        }

        isInstalled ? console.log(tl.loc("VersionFoundInCache", version)) : console.log(tl.loc("VersionNotFoundInCache", version));
        return isInstalled;
    }