How to use the @ts-common/azure-js-dev-tools.getDefaultLogger function in @ts-common/azure-js-dev-tools

To help you get started, we’ve selected a few @ts-common/azure-js-dev-tools 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 Azure / azure-sdk-for-js / .scripts / checkEverything.ts View on Github external
import { checkEverything, contains, getArgument, getDefaultLogger, gitDiff, GitDiffResult, gitStatus, GitStatusResult, joinPath, Logger, normalize, resolvePath } from "@ts-common/azure-js-dev-tools";
import * as path from "path";
import { getPackageFolderPaths } from "./common";

const logger: Logger = getDefaultLogger();
const changedFiles: string[] = [];

let headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
if (!headReference) {
  const statusResult: GitStatusResult = gitStatus();
  headReference = statusResult.localBranch!;
  logger.logInfo(`No head-reference argument specified on command line or in environment variables. Defaulting to "${headReference}".`);

  const modifiedFiles: string[] | undefined = statusResult.modifiedFiles;
  if (modifiedFiles) {
    changedFiles.push(...modifiedFiles);
  }
}

let baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
if (!baseReference) {