Skip to content

Commit 6fb1cda

Browse files
ENGG-3158: parse collection variables before writing in file (#135)
1 parent bd2a4f6 commit 6fb1cda

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/renderer/actions/local-sync/fs-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
getNameOfResource,
1111
getNormalizedPath,
1212
mapSuccessfulFsResult,
13-
mapSuccessWrite,
1413
parseContent,
1514
removeUndefinedFromRoot,
1615
} from "./common-utils";
@@ -24,7 +23,6 @@ import {
2423
copyRecursive,
2524
createFolder,
2625
deleteFsResource,
27-
getIfFileExists,
2826
getParentFolderPath,
2927
parseFile,
3028
parseFileResultToApi,
@@ -627,7 +625,7 @@ export class FsManager {
627625

628626
async setCollectionVariables(
629627
id: string,
630-
variables: Record<string, any>
628+
variables: Record<string, EnvironmentVariableValue>
631629
): Promise<FileSystemResult<Collection>> {
632630
try {
633631
const folder = this.createResource({
@@ -649,7 +647,9 @@ export class FsManager {
649647
return parseFolderToCollection(this.rootPath, folder);
650648
}
651649

652-
const writeResult = await writeContent(file, variables, Variables);
650+
const parsedVariables = parseToEnvironmentEntity(variables);
651+
652+
const writeResult = await writeContent(file, parsedVariables, Variables);
653653
if (writeResult.type === "error") {
654654
return writeResult;
655655
}

src/renderer/actions/local-sync/fs-utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,6 @@ export async function getAllWorkspaces(): Promise<
421421
return readResult;
422422
}
423423

424-
425-
426424
export function getParentFolderPath(fsResource: FsResource) {
427425
const { path } = fsResource;
428426
const name = getNameOfResource(fsResource);

0 commit comments

Comments
 (0)