Skip to content

Webstorm Ubuntu .bash_profile #1358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rhalff opened this issue Dec 17, 2015 · 2 comments
Closed

Webstorm Ubuntu .bash_profile #1358

rhalff opened this issue Dec 17, 2015 · 2 comments

Comments

@rhalff
Copy link

rhalff commented Dec 17, 2015

I've noticed the installer has created a .bash_profile

.bash_profile:

###-tns-completion-start-###
if [ -f /home/rhalff/.tnsrc ]; then
    source /home/rhalff/.tnsrc
fi
###-tns-completion-end-###

Normally Ubuntu does not have a .bash_profile and will load .bashrc.

The problem with the above is the rest of the environment will not get loaded while .bashrc is not being sourced.

Adding something like [[ -s ~/.bashrc ]] && source ~/.bashrc to the file would accomplish that.

I mention Webstorm, because it's terminal will consider loading .bash_profile instead of .bashrc which made it suddenly not load my normal environment anymore (e.g. nvm etc)

@Fatme Fatme added the bug label Jan 4, 2016
@teobugslayer teobugslayer added this to the 1.6.0 (Under consideration) milestone Jan 5, 2016
@teobugslayer teobugslayer modified the milestones: 1.7.0, 1.6.0 Feb 3, 2016
@teobugslayer teobugslayer modified the milestones: 2.0, 1.7.0 Feb 18, 2016
@rosen-vladimirov rosen-vladimirov modified the milestones: 2.1 (Under consideration), 2.0 Apr 18, 2016
@rosen-vladimirov rosen-vladimirov removed this from the 2.1 (Under consideration) milestone May 26, 2016
@hdeshev
Copy link
Contributor

hdeshev commented Jun 2, 2016

Looking at resources like:

I think the correct script to modify here would be the init script for interactive shells i.e. .bashrc. Login shells usually have their .profile/.bash_profile scripts set up so that they dot-source .bashrc, so tns completions will continue to work for those shells as well.

It seems the latest version of the service installing completions modifies all shell init scripts:

which seems incorrect. We should target .bashrc and .zshrc (if present) only.

@psnider
Copy link

psnider commented Jul 26, 2016

I had a similar problem on Mac.

OS: Mac El Capitan 10.11.5
tns: v2.1.1
Cross-platform modules: v2.1.0

I just installed nativescript via npm install -g nativescript but ran into a set of odd problems, which seem to have been caused by the install script creating a .bash_profile, which resulted in my .profile being skipped.

I've used .profile on Mac because many programs assume .profile.

It also appears that both the android installation and the java installation (run under the control of the nativescript install) both use .profile as well, as these two lines were added to the end of my .profile:

export ANDROID_HOME=/usr/local/opt/android-sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home

I was able to resolve my issues by adding the following to the top of my .bash_profile:

if [ -f /Users/peter/.profile ]; then
    source /Users/peter/.profile
fi

Copied from original issue: NativeScript/NativeScript#2506

@pkoleva pkoleva added this to the 3.0.0-RC milestone Feb 24, 2017
@pkoleva pkoleva removed this from the 3.0.0-RC milestone Apr 3, 2017
@etabakov etabakov added this to the 3.1.0 milestone Apr 27, 2017
@pkoleva pkoleva closed this as completed May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants