Skip to content

Commit

Permalink
Remove requirement of only modifying 1 folder (#9851)
Browse files Browse the repository at this point in the history
* remove requirement of only modifying 1 folder

* bump version
  • Loading branch information
wanlwanl authored Feb 18, 2025
1 parent 1da4b05 commit 4672d17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tools/js-sdk-release-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/js-sdk-release-tools",
"version": "2.7.19",
"version": "2.7.20",
"description": "",
"files": [
"dist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { modifyOrGenerateCiYml } from "../../utils/changeCiYaml";
import { changeConfigOfTestAndSample, ChangeModel, SdkType } from "../../utils/changeConfigOfTestAndSample";
import { changeRushJson } from "../../utils/changeRushJson";
import { getOutputPackageInfo } from "../../utils/getOutputPackageInfo";
import { getChangedCiYmlFilesInSpecificFolder, getChangedPackageDirectory } from "../../utils/git";
import { getChangedCiYmlFilesInSpecificFolder } from "../../utils/git";
import { logger } from "../../utils/logger";
import { RunningEnvironment } from "../../utils/runningEnvironment";
import { prepareCommandToInstallDependenciesForTypeSpecProject } from '../utils/prepareCommandToInstallDependenciesForTypeSpecProject';
Expand Down Expand Up @@ -194,19 +194,6 @@ export async function generateRLCInPipeline(options: {
const outputPackageInfo = getOutputPackageInfo(options.runningEnvironment, options.readmeMd, options.typespecProject);

try {
// TODO: need to refactor
// too tricky here, when relativePackagePath === undefined,
// the project should be typespec,
// and the changedPackageDirectories should be join(service-dir, package-dir)
if (!packagePath || !relativePackagePath) {
const changedPackageDirectories: Set<string> = await getChangedPackageDirectory(!options.skipGeneration);
if (changedPackageDirectories.size !== 1) {
throw new Error(`Find unexpected changed package directory. Length: ${changedPackageDirectories.size}. Value: ${[...changedPackageDirectories].join(', ')}. Please only change files in one directory`)
}
for (const d of changedPackageDirectories) relativePackagePath = d;
packagePath = path.join(options.sdkRepo, relativePackagePath!);
}

if (!packagePath || !relativePackagePath) {
throw new Error(`Failed to get package path`);
}
Expand Down

0 comments on commit 4672d17

Please sign in to comment.