How can I set my environment variable in atom when executing commands - environment-variables

I am trying to set my environment variables to
$env:DEBUG="*,-babel"
But I cant figure out where to use this setting in the Atom editor

To make the shell's environment variables available to Atom, install following two small atom packages:
env-from-shell
auto-run
env-from-shell settings: enter comma delimited list of needed environment variables in it's settings panel. Check off auto-run box.
auto-run settings: if not already present, enter env-from-shell:copy in it's settings panel. A benefit of the env-from-shell package is no external configuration files have to be moved from directory to directory as projects change.

Try setting
process.env.DEBUG = "*,-babel"
in your (new) $HOME/.atom/init.coffee init file.
(Your directory may vary, see your process.env.ATOM_HOME.)

Related

How do I permanently change the MSYS2 PATH?

I want to permanently add /mingw64/bin to the MSYS2 PATH.
I have tried:
export PATH=$PATH:/mingw64/bin
It works until I exit.
After I restart MSYS2 the path has reset to what it was before.
What do I need to do to add /mingw64/bin to the PATH so the change persists after I quit and restart the MSYS2 console?
You shouldn't manually add /??/bin to the PATH in the MSYS2 terminal.
It happens automatically (along with other changes to environment variables) when you open the terminal for the environment you want to use.
There should be different shortcuts for different environments, the one you're looking for should be named along the lines of ... MinGW 64-bit.
The shortcuts point to executables in C:\msys64, which you can run directly (this one is mingw64.exe).

Need Help understanding how PATH works with Windows 7

I am trying to add to the PATH via the Environment Variable settings windows for python.exe.
I have read the instructions using SetX from the March 3, 2012 discussion about this issue and am worried I will make a mess of my machine, so want to stick with the GUI process.
The directory path is C:\Users\Paul\AppData\Local\Programs\Python\Python37\python.exe.
That is a copy from the addition I made in the System Variables section of the Environment Variables window.
I have labelled the Variable Name as "Python", no quotation marks.
I have checked the path, and it looks good to me, and have rebooted the computer. But I still get the
'python.exe' is not recognized as an internal or external command, operable program or batch file.' error in every directory expect if I am specifically in the Python37 directory.
Any idea what I am doing wrong?
The path environment variable contains one or more paths, separated by semicolons. When you try to execute a command in cmd.exe it checks each path listed in the path variable in order of first to last until it finds the executable or runs out of paths to check.
You can experiment without making permanent changes to your system first. Run cmd.exe and type
set path=%path%;C:\Users\Paul\AppData\Local\Programs\Python\Python37
Running python.exe should now work in any directory in this cmd.exe window.
Unlike other environment variables, path is special and is a merged value from the system and user variables. Since you installed python just for yourself you might as well just use a user variable.
In the system properties where you edit environment variables, if there is no path user variable, create one and set it to C:\Users\Paul\AppData\Local\Programs\Python\Python37 or if it already exists, append ;C:\Users\Paul\AppData\Local\Programs\Python\Python37.
In newer versions of Windows 10 the UI is different and you don't have to add the semicolon because it lets you edit them as separate entries.

Scons doesn't use my environment variables such as PATH and LD_LIBRARY_PATH

I have a little problem.
I source a script which changes my RedHat environment (PATH, LD_LIBRARY_PATH, etc.i).
When I launch my install with scons, it charges the default Environment from my machine, but not the current that I loaded...
I tried several attempts, but it was not conclusive. Most of the answer on the net are relative to a change on one variable which have to be set in the SConstruct.
How can I tell scons to charge the current Environment, but not the default ?
Thanks in advance !
The SCons way would be to set these environment variables in your SConstruct/SConscripts so that every user would end up with a reproducible build environment.
Take a read of the FAQ for this: http://scons.org/faq.html#Why_doesn.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line.
SCons does not automatically propagate the external environment used to execute 'scons' to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked. This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, SCons will not find them unless you explicitly set the PATH to include those locations.
Already found the solution after some more search : env = Environment(ENV = os.environ)

specify env settings in command line

I have a node that runs several applications. These applications each have specific env settings. When I generate a release I start my node by just running ./rel/mynode/bin/mynode start. Is there an option that I could add to this command to override apps' env settings?
To answer your question: No, there is no parameter that you can pass into that command to load a different application env file.
However, if you are trying to load a different config file, for example a development file vs. a production file, you should check out how to do dynamic configuration with rebar.
I use it for running my application between different configured environments (production, and local testing).
I don't quite get what you mean by env settings. If you mean the applications configuration parameters that are set in the {Par,Val} tuples of the key env in the .app files then these can also be overridden in a system configuration file or directly in the command line. See the Configuring an Application section.

How to add to full environment path?

I need to add two directories to the environment path, but when I enter the first it gets cut of in the middle. It seems to me my environment path is full(there are quite a lot of things in there).
How can I add my two directories to the environment path?
I'm using Windows 7.
I guess you're working in windows.
Make 2 new environment variables.
Then add the 2 environment variables to the environment path by name like this:
%variable_name1%;%variable_name2%;
In windows:
PATH="PATH1";"PATH2";%PATH%
In Unix:
PATH="PATH":"PATH":%PATH%
Note: Quotes are requires if path contains spaces in between like c:\Program Files\abc

Resources