GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tilde ~ not recognized for Android SDK Path

christianhujer opened this issue · comments

$ bubblewrap init --manifest https://chatncharge.nelkinda.com/manifest.json
,-----.        ,--.  ,--.  ,--.
|  |) /_,--.,--|  |-.|  |-.|  |,---.,--.   ,--,--.--.,--,--.,---.
|  .-.  |  ||  | .-. | .-. |  | .-. |  |.'.|  |  .--' ,-.  | .-. |
|  '--' '  ''  | `-' | `-' |  \   --|   .'.   |  |  \ '-'  | '-' '
`------' `----' `---' `---'`--'`----'--'   '--`--'   `--`--|  |-'
                                                           `--'    
? Do you want Bubblewrap to install JDK?
  (Enter "No" to use your JDK installation) No
? Path to your existing JDK: /home/christian.hujer/.sdkman/candidates/java/11.0.19.fx-zulu/
? Do you want Bubblewrap to install Android SDK?
  (Enter "No" to use your installation) No
? Path to your existing Android SDK: ~/Android/Sdk
Android Sdk not found
? Path to your existing Android SDK: /home/christian.hujer/Android/Sdk

Describe the bug
When I enter the path to my Android Sdk with ~, bubblewrap does not find the Sdk. When I enter the full path, manually expanding ~ to my homedirectory, bubblewrap finds the Sdk. Like every well-behaved program that processes paths on a Unix system, bubblewrap should support tilde-expansion.

To Reproduce
Steps to reproduce the behavior:

  1. Start bubblewrap for the first time.
  2. Enter the path to your JDK.
  3. Enter the path to your Android Sdk, using ~

Expected behavior
A path with ~ is supported, expanding ~ to the user's home directory.

Actual behavior
bubblewrap doesn't find the Android Sdk when its path starts with ~.

Desktop (please complete the following information):

  • OS: Linux

Further Notes
I did not test other paths like the JDK path for tilde expansion. The bug might be with other paths as well.

I don't see anything obvious in the code (it just use's Node's fs implementation) - and, looking for the "Android Sdk not found" message in the code, I'm not able to find it. Need to try to reproduce to understand what's going on.