Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12366] CLI: Allow tilde use for paths

GitHub Issuen/a
TypeBug
PriorityHigh
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.0.0
Fix Version/s2013 Sprint 22, 2013 Sprint 22 Core, Release 3.2.0
ComponentsCLI
Labelscb-tooling
ReporterEric Merriman
AssigneeChris Barber
Created2013-01-22T02:19:59.000+0000
Updated2016-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

Comments

  1. Chris Barber 2013-03-03

    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).
  2. Chris Barber 2013-10-25

    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 ~.
  3. Samuel Dowse 2013-11-15

    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.
  4. Fokke Zandbergen 2016-04-08

    This is still/again an issue:
       ───────────────────┤ Android Settings ├───────────────────
       
       Path to the Android SDK
       Enter "none" if you don't want to build for Android.
       : ~/Library/Android/sdk
       [ERROR] Invalid Android SDK path
       Required file does not exist: "~/Library/Android/sdk/tools/android"
       
       : /users/fokkezb/Library/Android/sdk
       
       Path to the Android NDK
       Only required for building native Titainum Modules.
       :
       

JSON Source