NativeScript / NativeScript/nativescript-cli
`tns run android` appends to .bash_profile/.zprofile even if denied for local build configuration
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 1.1k
- Forks
- 204
- Merge moyen
- 1 j 9 h
- PR mergées (30 j)
- 8
Description
Environment
- CLI: 6.1.2
- Cross-platform modules: 6.0.7
- Android Runtime: 6.1.2
- iOS Runtime: 6.1.1
- Plugin(s): -
Describe the bug
When running tns run android and if the environment is not properly set up, the automatic environment setup script for a local build will automatically append JAVA_HOME and ANDROID_HOME, as well as ANDROID_SDK_ROOT to .bash_profile / .zprofile even if install steps 3 and 4 are rejected.
This happens every time the installer is run up to these steps which leads to a spammed .bash_profile / .zprofile if the installer needs to be aborted or restarted a couple of times. This will also overwrite previously set variables.
The output of the cli is as follows:
Step 3 of 12:
Allow the script to install Open JDK 8?
(Y)es/(N)o
n
You have chosen not to install Open JDK 8. Some features of NativeScript may not work correctly if you haven't already installed it
Set JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
Step 4 of 12:
Allow the script to install Android SDK?
Note that if you type all you won't be prompted for subsequent installations
(Y)es/(N)o/(A)ll
n
You have chosen not to install Android SDK. Some features of NativeScript may not work correctly if you haven't already installed it
Set ANDROID_HOME=/usr/local/share/android-sdk
Set ANDROID_SDK_ROOT=/usr/local/share/android-sdk
Configuring your system for Android development... This might take some time, please, be patient.
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
zsh:1: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager
WARNING: There seem to be some problems with the Android configuration
To Reproduce
- Have an incomplete environment set up (e.g. do not have
ANDROID_HOMEas environment variable set) - run
tns run androidin your project - choose
configure local build - deny all steps 3 and 4
- check
.bashprofile/.zprofile
Expected behavior
Have the setup script not append variables in .bashprofile / .zprofile or replace the variables if installation steps 3 and 4 are rejected.
Additional context
My .bash_profile after I had to retry the installer a couple of times:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Ho$
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Ho$
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Ho$
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Ho$
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Ho$
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le flux CLI tns run android et la configuration automatique de l’environnement utilisée par configure local build ; reproduisez la séquence d’invites en refusant les étapes 3 et 4. Suivez le moment où JAVA_HOME, ANDROID_HOME et ANDROID_SDK_ROOT sont écrites dans .bash_profile ou .zprofile. Le travail est considéré comme terminé lorsque les étapes d’installation refusées n’ajoutent pas ces variables et ne les remplacent pas, y compris après plusieurs nouvelles tentatives.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, javascript
- Domaine
- cli, mobile
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100