ui5experts / ui5-schemas

:rocket: UI5 Schemas allows you to develop SAPUI5/OpenUI5 XML at a maximum convenience. It downloads, upgrades and sets up SAPUI5/OpenUI5 XML schemas for a better development experience in your favorite IDE (if it is WebStorm ;).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ui5-schemas shell script fails to link WebStorm's ProjectResources

vobu opened this issue · comments

steps to reproduce:

  • add ui5schemas to existing src code repo via package.json: npm install ui5-schemas --save
  • run ui5-schemas (here via node_modules/.bin/ui5-schemas)
  • (downloads fine), then link error occurs
Discovered an .idea project!
Registering schemas...
{ Error: ENOENT: no such file or directory, open '/Users/xyz/git/my_modules/.idea/misc.xml'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/xyz/git/my_modules/.idea/misc.xml' }

Proposed solution: check for .idea/misc.xml first and create if it doesn't exist

macOS 10.12.6
node 8.3.0

while on it, poked around a little and checked that creating a default misc.xml with this content should be sufficient:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project version="4">
</project>

Hi Volker,

thanks for reporting. I've already experienced that very same issue myself... Will try to look into it soon. Contributions are of course more than welcome.

BR
Chris

thx for the quick update. getting close, but still doesn't entirely solve the issue:

Naunet: 11:03 ~/bla > node_modules/.bin/ui5-schemas 
ui5-schemas info Preparing 'sapui5' schemas in version 'latest'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas info [link] Discovered an .idea project! Registering schemas...
ui5-schemas warn [link] '/Users/xyz/bla/.idea/misc.xml' doesn't exist. Creating...
ui5-schemas error [link] { Error: ENOENT: no such file or directory, lstat 'templates/misc.xml'
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: 'templates/misc.xml' }
ui5-schemas info [enhance] Enhancing done!

file is there though, just the path isn't correct:

Naunet: 11:03 ~/bla > file node_modules/ui5-schemas/templates/misc.xml 
node_modules/ui5-schemas/templates/misc.xml: XML 1.0 document text, ASCII text

argh :D
Just tested from the module dir itself... I should definitely start writing unit tests... Hang on!

This should do, just released as 0.2.1

smooth sailing now, confirmed!