Skip to content

When 'Open in new workspace' and 'Add to workspace' should be shown.

Compare
Choose a tag to compare
@ira-gordin-sap ira-gordin-sap released this 07 Oct 12:34
· 345 commits to master since this release
1a585e6

Show the 'Open in new workspace' and 'Add to workspace' buttons only in case correct targetFolderPath/destinationRoot is known: generator changed the destinationRoot or destinationRoot was not changed and one new folder created by generator.
Additional bugs fixes:
Scenario 1:
File -> New Project From Template
Specify a target folder path: /home/user/ (remove projects manually).
Choose MTA -> name it mta -> complete and choose "Add project to workspace".
Result: user folder added to workspace.
Expected result: user/mta folder added to workspace.
Works correctly if target folder path: /home/user (without slash at the end).
Fix: use resolve to remove / as well.
Scenario 2:
File -> New Project From Template
Specify a target folder path: lib (fill manually).
Choose MTA -> name it mta -> complete.
Result: project generation fails with the following message:
{"message":"basic-multitarget-application generator failed - mkdir /theia: permission denied","stack":"Error: mkdir /theia: permission denied\n at ChildProcess. (/extbin/generators/lib/node_modules/generator-basic-multitarget-application/node_modules/@sap/mta-lib/lib/index.js:60:20)\n at ChildProcess.emit (events.js:315:20)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)"}
Root cause: in case of relative path the code use theia current directory (/theia/browser-app/).
Fix: use resolve(outputPath, ...) to create an absolute path based on outputPath.