[TIMOB-28226] Liveview: Build errors if project directory path contains Resources
GitHub Issue | n/a |
Type | Bug |
Priority | None |
Status | In Review |
Resolution | Unresolved |
Affected Version/s | Release 9.3.0, Release 9.2.2 |
Fix Version/s | n/a |
Components | LiveView |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Ewan Harris |
Created | 2020-11-04T10:40:55.000+0000 |
Updated | 2020-11-04T14:43:54.000+0000 |
Description
Description
If a project directory path contains Resources
anywhere in the path (e.g. /Users/ewan/Resources/my-titanium-app/) then liveview will error out with Project directory "<project directory parent>" is not a valid Titanium project
(e.g. Project directory "/Users/ewan/Resources/" is not a valid Titanium project
This is because liveview is performing a bad lookup on whether the provided project directory contains Resources
or not, and then popping off the last segment of the path regardless of where Resources
is found
Steps to reproduce
1. Create a project called Resources
2. cd into that directory and create a new titanium app
3. Build the project with liveview enabled
Actual
Liveview complains that the parent directory is not a titanium project
Expected
Liveview should function just fine
Comments
JSON Source
PR: https://github.com/appcelerator/liveview/pull/205 To apply this fix before it ships: 1. Open
~/Library/Application Support/Titanium/mobilesdk/<OS>/<SDK>/node_modules/liveview/lib/fserver.js
where OS is one of osx, linux, or win32 and SDK is the SDK version you want to apply the fix to 2. Look forRESOURCE_DIR = (!~RESOURCE_DIR.indexOf('Resources')) ? RESOURCE_DIR + '/Resources' : RESOURCE_DIR;
(should be line 165) and replace with the below