Skip to content

Commit

Permalink
updated the function removeConfigDir
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Dec 4, 2024
1 parent 9c3b83a commit 4d2fa91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/GradleSingleModLCLSTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('LCLS Test for Gradle Project', function () {

after(() => {

utils.removeProjectFolderWithContent(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2'));
utils.removeConfigDir(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2'));
console.log("Removed new config folder:");

});
Expand Down
7 changes: 5 additions & 2 deletions src/test/utils/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export async function clearCommandPalette() {
/**
* Remove newly created Project folder with content
*/
export async function removeProjectFolderWithContent(projectPath: string): Promise<void> {
export async function removeConfigDir(projectPath: string): Promise<void> {
try {
await fs.accessSync(projectPath);
const projectContent = await fs.readdirSync(projectPath);
Expand All @@ -206,7 +206,7 @@ export async function removeProjectFolderWithContent(projectPath: string): Promi
const projectContentPath = path.join(projectPath, projectFiles);
const stats = await fs.lstatSync(projectContentPath);
if (stats.isDirectory()) {
await removeProjectFolderWithContent(projectContentPath);
await removeConfigDir(projectContentPath);
} else {
await fs.unlinkSync(projectContentPath);
}
Expand All @@ -218,6 +218,9 @@ export async function removeProjectFolderWithContent(projectPath: string): Promi
}
}

/**
* Copy config directory and create new config
*/
export async function copyConfig(existingConfigPath: string, copyConfigPath: string): Promise<void> {
fse.copy(existingConfigPath, copyConfigPath)
.then(() => console.log("New config folder created :" + copyConfigPath))
Expand Down

0 comments on commit 4d2fa91

Please sign in to comment.