Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = PackagesToPack[option] as any;
break;
}
}
}
return result;
}
const args: CommandLineOptions = getCommandLineOptions();
const _logger: Logger = Logger.get();
const azureSDKForJSRepoRoot: string = getArgument("azure-sdk-for-js-repo-root", { defaultValue: __dirname })!;
const rawToPack: string | undefined = getArgument("to-pack");
let toPack: PackagesToPack = getPackagesToPackArgument(rawToPack);
const headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
const baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
function getDropFolderPath(): string {
let result: string | undefined = getArgument("drop");
if (!result) {
result = "drop";
}
if (!path.isAbsolute(result)) {
result = path.join(azureSDKForJSRepoRoot, result);
}
return result;
}
const dropFolderPath: string = getDropFolderPath();
if (!fs.existsSync(dropFolderPath)) {
fs.mkdirSync(dropFolderPath);
}
function getDropFolderPath(): string {
let result: string | undefined = getArgument("drop");
if (!result) {
result = "drop";
}
if (!path.isAbsolute(result)) {
result = path.join(azureSDKForJSRepoRoot, result);
}
return result;
}
if (toPackArgument) {
const toPackArgumentLower: string = toPackArgument.toLowerCase();
for (const option in PackagesToPack) {
if (option.toLowerCase() === toPackArgumentLower) {
result = PackagesToPack[option] as any;
break;
}
}
}
return result;
}
const args: CommandLineOptions = getCommandLineOptions();
const _logger: Logger = Logger.get();
const azureSDKForJSRepoRoot: string = getArgument("azure-sdk-for-js-repo-root", { defaultValue: __dirname })!;
const rawToPack: string | undefined = getArgument("to-pack");
let toPack: PackagesToPack = getPackagesToPackArgument(rawToPack);
const headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
const baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
function getDropFolderPath(): string {
let result: string | undefined = getArgument("drop");
if (!result) {
result = "drop";
}
if (!path.isAbsolute(result)) {
result = path.join(azureSDKForJSRepoRoot, result);
}
return result;
}
if (option.toLowerCase() === toPackArgumentLower) {
result = PackagesToPack[option] as any;
break;
}
}
}
return result;
}
const args: CommandLineOptions = getCommandLineOptions();
const _logger: Logger = Logger.get();
const azureSDKForJSRepoRoot: string = getArgument("azure-sdk-for-js-repo-root", { defaultValue: __dirname })!;
const rawToPack: string | undefined = getArgument("to-pack");
let toPack: PackagesToPack = getPackagesToPackArgument(rawToPack);
const headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
const baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
function getDropFolderPath(): string {
let result: string | undefined = getArgument("drop");
if (!result) {
result = "drop";
}
if (!path.isAbsolute(result)) {
result = path.join(azureSDKForJSRepoRoot, result);
}
return result;
}
const dropFolderPath: string = getDropFolderPath();
if (!fs.existsSync(dropFolderPath)) {
fs.mkdirSync(dropFolderPath);
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) {
baseReference = "master";
logger.logInfo(`No base-reference argument specified on command line or in environment variables. Defaulting to "${baseReference}".`);
}
if (baseReference !== headReference) {
const diffResult: GitDiffResult = gitDiff(baseReference, headReference);
changedFiles.push(...diffResult.filesChanged);
if (!changedFiles || changedFiles.length === 0) {
logger.logInfo(`Found no changes between "${baseReference}" and "${headReference}".`);
} else {
logger.logVerbose(`Found the following changed files`)
for (const changedFilePath of changedFiles) {
logger.logVerbose(changedFilePath);
}
}
const toPackArgumentLower: string = toPackArgument.toLowerCase();
for (const option in PackagesToPack) {
if (option.toLowerCase() === toPackArgumentLower) {
result = PackagesToPack[option] as any;
break;
}
}
}
return result;
}
const args: CommandLineOptions = getCommandLineOptions();
const _logger: Logger = Logger.get();
const azureSDKForJSRepoRoot: string = getArgument("azure-sdk-for-js-repo-root", { defaultValue: __dirname })!;
const rawToPack: string | undefined = getArgument("to-pack");
let toPack: PackagesToPack = getPackagesToPackArgument(rawToPack);
const headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
const baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
function getDropFolderPath(): string {
let result: string | undefined = getArgument("drop");
if (!result) {
result = "drop";
}
if (!path.isAbsolute(result)) {
result = path.join(azureSDKForJSRepoRoot, result);
}
return result;
}
const dropFolderPath: string = getDropFolderPath();
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) {
baseReference = "master";
logger.logInfo(`No base-reference argument specified on command line or in environment variables. Defaulting to "${baseReference}".`);
}