-
Notifications
You must be signed in to change notification settings - Fork 36
Command Line Usage
Our template repository assumes that you have command line usage set up for the core tools used in our projects. This allows us to use the GSLab Make library to run multiple applications in a single build script.
To set up an application for command line usage, its executable must be added to the system environment variable PATH so that your operating system can locate it. We provide instructions on how to add an executable to PATH for Mac and Windows.
By default, our template repository assumes the following executable names for the following applications:
application : executable
Python : python
git-lfs : git-lfs
LyX : lyx
R : Rscript
Stata : statamp (will need to be updated if using a version of Stata that is not Stata-MP)
While these are the standard executable names for Mac, it is possible that they may differ on your computer. Default executable names can be updated in config_user.yaml
. For further detail, see discussion on the Config page.
To check if an application is setup for command line usage, type which executable
into a terminal. If no path appears, then the application is not setup for command line usage. To add the executable of an application to PATH:
-
Locate the executable for an application. For example, the executable for Stata is typically found at
/Applications/Stata/StataMP.app/Contents/MacOS/statamp
. -
In a terminal, from your user directory (
/Users/name
) run the following bash commands:touch .bash_profile nano .bash_profile
-
The Nano editor should appear in your terminal. Type in the path to the executable into the Nano editor in the following format
PATH="$PATH:path_to_executable
wherepath_to_executable
refers to the full path of the directory containing the executable.For example, if your Stata executable was located in
/Applications/Stata/StataMP.app/Contents/MacOS/statamp
, you would want to type in the following text into the Nano editor:PATH="$PATH:/Applications/Stata/StataMP.app/Contents/MacOS/
. -
Save and exit the Nano editor by pressing CTRL + X, Y, and enter.
By default, our template repository assumes the following executable names for the following applications:
application : executable
Python : python
git-lfs : git-lfs
LyX : lyx
R : Rscript
Stata : statamp
However, these are the default executable names for Mac and therefore likely to differ on your computer. Default executable names can be updated in config_user.yaml
. For further detail, see discussion on the Config page.
Executable names for Windows will typically look like the following:
application : executable
Python : python
git-lfs : git-lfs
LyX : LyX#.# (where #.# refers to the version number)
R : Rscript
Stata : stata_executable
stata_executable
refers to name of your Stata executable. For example, if your Stata executable was located in C:\Program Files\Stata15\StataMP-64.exe
, you would want to type in the following into your config_user.yaml
: stata: StataMP-64
. You would then want to add your Stata executable to PATH.
To check if an application is setup for command line usage, type where executable
into a terminal. If no path appears, then the application is not setup for command line usage. To add the executable of an application to PATH:
-
Locate the executable for an application. For example, the executable for R might be found at
C:\Program Files\R\R-3.5.0\bin\x64\RScript.exe
. -
In your start menu, search "environment". Click on
Edit the system environment variables
. -
Click on
Environment Variables
. You should see a panel that is labeledUser Variables
. In the panel, click on the variable calledPath
. -
Click on
Edit
. Click onNew
. -
Type in the full path of the directory containing the executable.
For example, if your R executable was located in
C:\Program Files\R\R-3.5.0\bin\x64\RScript.exe
, you would want to type in the following text:C:\Program Files\R\R-3.5.0\bin\x64\
-
Click
OK
.