[TIMOB-12366] CLI: Allow tilde use for paths
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2013 Sprint 22, 2013 Sprint 22 Core, Release 3.2.0 |
Components | CLI |
Labels | cb-tooling |
Reporter | Eric Merriman |
Assignee | Chris Barber |
Created | 2013-01-22T02:19:59.000+0000 |
Updated | 2016-08-19T04:27:51.000+0000 |
Description
While trying to test prompted options in the CLI I encountered and error trying to use "~/Documents". Using the full path did work (/Users/emerriman/Documents…), but it was not evident that the tilde was the problem initially and took me a moment to figure out.
Steps to reproduce:
1) Use ti CLI to create a project
2) Ensure you do not have the Android SDK in your config file
3) Place your Android SDK in your user folder
4) Perform a build with -p android and let the CLI prompt you for the path to the Android SDK
5) Use the "~" to start your path
Result:
[ERROR] Invalid Android SDK path
Expected:
Build proceeds as expected
This is going to take some major work to fix. The problem is the Android build will try to find your Android SDK using the config or some common places to look for it. Since it won't find the Android SDK, it will prompt for the location. Once we prompt for it, we've already done detection, so we need to re-detect based on the newly supplied Android SDK path. But since Android environment detection is async, there's no way to do call anything async between the prompting and the validate(). To fix this: 1. Add async friendly post-prompt phase to Titanium CLI 2. During validate(), if androidEnv is undefined/null, call android.detect() with newly supplied Android SDK path and then continue with current validation logic. I'm going to shelf this until the new prompting library gets integrated into the CLI (TIMOB-11267) and we add support for iteratively processing prompted values (TIMOB-11869).
This was fixed as apart of the new Android build. I scanned a number of other places that accept paths and everything appears to allow ~.
Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311150750 Titanium SDK, build: 3.2.0.v20131114184328 CLI: 3.2.0 Alloy: 1.3.0 Started Android SDK path with ~/. The SDK was detected and the project ran successfully on emulator. Closing.
This is still/again an issue: