fix: Terms (#6)

This commit is contained in:
Collin Jackson 2024-10-08 17:47:55 -07:00 committed by GitHub
parent a613ae9bfa
commit b5aad54d42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 25 deletions

View File

@ -5,7 +5,7 @@ Command line interface (CLI) for accessing the Nexus Network. Highest-performanc
## Quick start ## Quick start
``` ```
curl https://network-cli.nexus.xyz/install.sh | sh curl https://cli.nexus.xyz/install.sh | sh
``` ```
If you do not already have Rust, you will be prompted to install it. If you do not already have Rust, you will be prompted to install it.
@ -15,7 +15,7 @@ If you do not already have Rust, you will be prompted to install it.
Use of the CLI is subject to the [Terms of Use](https://nexus.xyz/terms_of_use). Use of the CLI is subject to the [Terms of Use](https://nexus.xyz/terms_of_use).
The first time you run it, it prompts you to accept the terms. To accept the terms The first time you run it, it prompts you to accept the terms. To accept the terms
noninteractively (for example, in a continuous integration environment), noninteractively (for example, in a continuous integration environment),
add `NONINTERACTIVE=1` at the start of the command. add `NONINTERACTIVE=1` before `sh`.
## Known issues ## Known issues

View File

@ -74,19 +74,6 @@ async fn main() {
// If the prover_id file is found, use the contents, otherwise generate a new random id // If the prover_id file is found, use the contents, otherwise generate a new random id
// and store it. // and store it.
let _ = match env::var("NONINTERACTIVE") {
Ok(_) => (),
Err(_) => {
println!(
"Do you agree to the Nexus Beta Terms of Use (https://nexus.xyz/terms-of-use)? (Y/n)"
);
let mut input = String::new();
let _ = std::io::stdin().read_line(&mut input);
if input.chars().nth(0).unwrap() == 'n' || input.chars().nth(0).unwrap() == 'N' {
return ();
}
}
};
let mut prover_id = format!( let mut prover_id = format!(
"{}-{}-{}", "{}-{}-{}",
random_word::gen(Lang::En), random_word::gen(Lang::En),

View File

@ -2,18 +2,30 @@
rustc --version || curl https://sh.rustup.rs -sSf | sh rustc --version || curl https://sh.rustup.rs -sSf | sh
NEXUS_HOME=$HOME/.nexus NEXUS_HOME=$HOME/.nexus
CLI_ZIP=/tmp/nexus-network-api.zip
curl -L --verbose "https://docs.google.com/uc?export=download&id=1kcbEeKpVEyvIqL-_cgR5sYdZe_fOEPs6" > $CLI_ZIP while [ -z "$NONINTERACTIVE" ]; do
if [ -d "$NEXUS_HOME" ]; then read -p "Do you agree to the Nexus Beta Terms of Use (https://nexus.xyz/terms-of-use)? (Y/n) " yn </dev/tty
echo "$NEXUS_HOME exists. Updating."; case $yn in
(cd $NEXUS_HOME && rm -rf network-api && unzip $CLI_ZIP) [Nn]* ) exit;;
# TODO: Once GitHub repo is public, do this instead [Yy]* ) break;;
# (cd $NEXUS_HOME && git pull) "" ) break;;
* ) echo "Please answer yes or no.";;
esac
done
git --version 2>&1 >/dev/null
GIT_IS_AVAILABLE=$?
if [ $GIT_IS_AVAILABLE != 0 ]; then
echo Unable to find git. Please install it and try again.
exit 1;
fi
if [ -d "$NEXUS_HOME/network-api" ]; then
echo "$NEXUS_HOME/network-api exists. Updating.";
(cd $NEXUS_HOME/network-api && git pull)
else else
# TODO: Once GitHub repo is public, do this instead
# git clone git@github.com:nexus-xyz/network-cli $NEXUS_HOME
mkdir -p $NEXUS_HOME mkdir -p $NEXUS_HOME
(cd $NEXUS_HOME && unzip $CLI_ZIP) (cd $NEXUS_HOME && git clone git@github.com:nexus-xyz/network-cli)
fi fi
(cd $NEXUS_HOME/network-api/clients/cli && cargo run --release --bin prover -- beta.orchestrator.nexus.xyz) (cd $NEXUS_HOME/network-api/clients/cli && cargo run --release --bin prover -- beta.orchestrator.nexus.xyz)