Skip to content

Commit

Permalink
Fix export option for imdi only
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Mar 4, 2023
1 parent 85615ec commit 4eb460e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/export/ExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const ExportDialog: React.FunctionComponent<{
ImdiBundler.saveImdiBundleToFolder(
props.projectHolder.project!,
path,
IMDIMode.OPEX,
IMDIMode.RAW_IMDI,
false,
folderFilter
);
Expand Down
15 changes: 12 additions & 3 deletions app/export/ImdiBundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class ImdiBundler {
session2/
...files...
*/
/* for opes, we want
/* for opex, we want
myproject_3-6-2019/ <--- rootDirectory
myproject/ <--- "secondLevel"
Expand Down Expand Up @@ -298,11 +298,20 @@ export default class ImdiBundler {
: ".imdi" /* tells basename to strip this off*/
)
);
fs.ensureDirSync(destinationFolderPath);
const imdiOnlyFolderPath = Path.join(rootDirectory, secondLevel);
if (imdiMode === IMDIMode.OPEX) {
// only in OPEX mode do we create the folder itself
fs.ensureDirSync(destinationFolderPath);
} else {
// in IMDI mode, we create the folder for the imdi file only
fs.ensureDirSync(imdiOnlyFolderPath);
}

//else fs.ensureDirSync(Path.basename(destinationFolderPath));
const directoryForMetadataXmlFile =
imdiMode === IMDIMode.OPEX
? destinationFolderPath // in there with the files it describes
: Path.join(rootDirectory, secondLevel); // one level above the files it describes
: imdiOnlyFolderPath; // one level above the files it describes

fs.writeFileSync(
Path.join(
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "lameta",
"productName": "lameta",
"version": "2.1.1-alpha",
"version": "2.1.2-alpha",
"description": "File & metadata organization for language documentation projects.",
"main": "./main-bundle.js",
"author": {
"name": "lameta",
"email": "sorryno@email.org"
},
"license": "MIT"
}
}

0 comments on commit 4eb460e

Please sign in to comment.