From 7f4ad1dd7a6a67c9b4e7681cf37db30029638637 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 3 Feb 2026 23:38:29 +0800 Subject: [PATCH] add options --- README.md | 7 +++++++ abacus1s.sh | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28658dc..81233a1 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,10 @@ Just copy and paste in 1s, and let it run. curl -fsSL https://cdn.jsdmirror.com/gh/deepmodeling-activity/abacus1s/abacus1s.sh | bash ``` +## Options + +The installation script has several options that can be manipulated through environment variables. + +- `ABACUS1S_HOME`: The location of the binary folder. (default: `$HOME/.abacus1s`) +- `ABACUS1S_NO_PATH_UPDATE`: If set the `$PATH` will not be updated to add pixi to it. +- `ABACUS_VERSION`: The version of ABACUS getting installed, can be used to up- or down-grade. diff --git a/abacus1s.sh b/abacus1s.sh index b785568..6347c23 100755 --- a/abacus1s.sh +++ b/abacus1s.sh @@ -22,7 +22,7 @@ logging() { } logging "This script will automatically download and install ABACUS (${ABACUS_VERSION:-"lastest version"}) for you." -ABACUS1S_HOME=~/.abacus1s +ABACUS1S_HOME=${ABACUS1S_HOME:-~/.abacus1s} export PIXI_HOME=$ABACUS1S_HOME ABACUS1S_BIN_PATH=$ABACUS1S_HOME/bin @@ -42,6 +42,9 @@ fi # 2. install pixi ((progress++)) logging "Install pixi" +if [[ -v ABACUS1S_NO_PATH_UPDATE ]]; then + export PIXI_NO_PATH_UPDATE=1 +fi curl -fsSL https://pixi.sh/install.sh | sh @@ -67,5 +70,10 @@ $ABACUS1S_BIN_PATH/mpirun --version logging "Remove pixi to prevent conflict" rm -f $ABACUS1S_BIN_PATH/pixi -logging "ABACUS have been installed to ${ABACUS1S_BIN_PATH}. Restart the shell to use abacus and mpirun." +if [[ -v ABACUS1S_NO_PATH_UPDATE ]]; then + logging "ABACUS have been installed to ${ABACUS1S_BIN_PATH}. To activate the environment, add the following script before your script:" + logging "export PATH=${ABACUS1S_BIN_PATH}:\$PATH" +else + logging "ABACUS have been installed to ${ABACUS1S_BIN_PATH}. Restart the shell to use abacus and mpirun." +fi