docs: add environment reloading commands

This commit is contained in:
Amin Yahyaabadi 2022-01-17 18:51:14 -08:00
parent c6a5745cec
commit aa55c63ddb
4 changed files with 24 additions and 0 deletions

View File

@ -51,6 +51,8 @@ An example that installs llvm, cmake, ninja, ccache, and vcpkg:
# windows example (open shell as admin) # windows example (open shell as admin)
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_windows.exe" curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_windows.exe"
./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true ./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
RefreshEnv.cmd # reload the environment
``` ```
```ps1 ```ps1
@ -58,6 +60,8 @@ curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cp
wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_linux" wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_linux"
chmod +x setup_cpp_linux chmod +x setup_cpp_linux
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.profile # reload the environment
``` ```
```ps1 ```ps1
@ -65,11 +69,15 @@ sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true -
wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_mac" wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_mac"
chmod +x setup_cpp_mac chmod +x setup_cpp_mac
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.profile # reload the environment
``` ```
NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`. NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`.
For the tools, instead of `true` that chooses the default version, you can pass a specific version. For the tools, instead of `true` that chooses the default version, you can pass a specific version.
NOTE: you will not need `sudo` if you are already a root user (e.g., in a GitLab runner).
### With Nodejs ### With Nodejs
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js), and run it with the available options. Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js), and run it with the available options.
@ -82,6 +90,8 @@ Open the shell as admin, download via `curl`, then install
# open shell as admin # open shell as admin
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js" curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js"
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
RefreshEnv.cmd # reload the environment
``` ```
On Linux or Mac: On Linux or Mac:
@ -89,6 +99,8 @@ On Linux or Mac:
```ps1 ```ps1
wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js" wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js"
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.profile # reload the environment
``` ```
# Inside GitHub Actions # Inside GitHub Actions
@ -168,6 +180,9 @@ RUN chmod +x ./setup_cpp_linux
# install llvm, cmake, ninja, and ccache # install llvm, cmake, ninja, and ccache
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true
# reload the environment
RUN source ~/.profile
ENTRYPOINT [ "/bin/sh" ] ENTRYPOINT [ "/bin/sh" ]
``` ```

View File

@ -12,4 +12,7 @@ RUN chmod +x ./setup_cpp_linux
# install llvm, cmake, ninja, and ccache # install llvm, cmake, ninja, and ccache
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true
# reload the environment
CMD source ~/.profile
ENTRYPOINT [ "/bin/sh" ] ENTRYPOINT [ "/bin/sh" ]

View File

@ -8,4 +8,7 @@ WORKDIR "/"
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true
# reload the environment
CMD source ~/.profile
ENTRYPOINT [ "/bin/sh" ] ENTRYPOINT [ "/bin/sh" ]

View File

@ -12,4 +12,7 @@ RUN apt-get install -y --no-install-recommends unzip
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
# reload the environment
CMD source ~/.profile
ENTRYPOINT [ "/bin/sh" ] ENTRYPOINT [ "/bin/sh" ]