Skip to content

Commit

Permalink
Merge pull request #25 from PatrickMurrell/addIdsToMetaDataJson
Browse files Browse the repository at this point in the history
Add necessary ids for initial import to metadata json.
  • Loading branch information
NickRimmer authored Jun 27, 2023
2 parents 68f10b4 + a712941 commit 2aa8ecb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/services/workspace-service-multiple-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ export class WorkspaceServiceMultipleFiles extends WorkspaceServiceBase {
await writeFile(resourceFilePath, WorkspaceServiceBase.stringifyExportData(resource), {encoding: 'utf8'})
}

data.resources = []
data.resources = data.resources.filter(x =>
x._id.startsWith('wrk') ||
x._id.startsWith('spc') ||
(x._id.startsWith('env') && x.name === "Base Environment")
)

data.resources.forEach(resource => {
if(resource?.contents) resource.contents = "";
if(resource?.data) resource.data = {};
if(resource?.dataPropertyOrder) resource.dataPropertyOrder = {};
})

await writeFile(
path.join(configuration.filePath!, WorkspaceServiceMultipleFiles.metaFileName),
WorkspaceServiceBase.stringifyExportData(data), {encoding: 'utf8'},
Expand Down

0 comments on commit 2aa8ecb

Please sign in to comment.