SAP / cf-html5-apps-repo-cli-plugin

Cloud Foundry CLI plugin to work with SAP Cloud HTML5 Applications Repository
Apache License 2.0
43 stars 6 forks source link

Paths of resources are not correct in zip #3

Closed Niklasschoenb closed 5 years ago

Niklasschoenb commented 5 years ago

Assume the following folder structure:

dist
 |- css
       |-....css files
  |- i18n
       |-....i18n files
  |- manifest.json
  |- xs-app.json
  |- Component.js
  |-....further app content

Now I run the command "cf html5-push dist "" While the command is being executed, I grab the zip file that is generated. It has the following content structure:

dist
  |- css
        |-dist
              |-css
                   |-....css files
  |- i18n
        |-dist
             |-i18n
                   |-....i18n files
  |- manifest.json
  |- xs-app.json
  |- Component.js
  |-....further app content

Of course my webapp won't be able to load the css / i18n files because there is a superfluous "dist" + folder name in the path. But what is really strange, even when adding the superfluous "dist" + folder name in the url path to the resource files, the files are not found. Only the files under the root level such as "Component.js" are found. This happens under Windows, cf cli version 6.38

micellius commented 5 years ago

Hello @Niklasschoenb. Thanks for opening the issue. Can you please provide the following additional info to better understand your case:

micellius commented 5 years ago

NGPBUG-76291

Niklasschoenb commented 5 years ago

@micellius It seems like the issue still occurs under linux if the PATH_TO_APP_FOLDER argument is not a relative path, but an absolute one.

micellius commented 5 years ago

@Niklasschoenb Thanks for reporting an issue. I tried to reproduce it and figured out that it is not relevant to absolute or relative path. It is even not the issue with slashes. GO relies on existence of $TMPDIR environment variable to get temporary directory path, which is used to store temporary zip of application folder by html5-plugin. On some Linux distributions (I managed to reproduce it on RHEL 7.3) this variable is not set. Therefore, you can easily fix it by export TMPDIR=/tmp/ (don't forget trailing slash) before running cf html5-push .... Anyway, I'll address this issue in one of the next commits.