Skip to content

Commit

Permalink
Email arg in start script (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-gerber committed Oct 26, 2022
1 parent 295380a commit 685cd2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
3 changes: 1 addition & 2 deletions install.sh
Expand Up @@ -2,5 +2,4 @@

git clone https://github.com/faros-ai/faros-community-edition.git
cd faros-community-edition || exit
./start.sh --run-cli

./start.sh --run-cli "$@"
21 changes: 14 additions & 7 deletions start.sh
Expand Up @@ -24,6 +24,9 @@ function parseFlags() {
--run-cli)
run_cli=1
shift 1 ;;
--email)
email_override=$2
shift 2 ;;
*)
echo "Unrecognized arg: $1"
shift ;;
Expand All @@ -33,15 +36,19 @@ function parseFlags() {

main() {
parseFlags "$@"

EMAIL_FILE=".faros-email"
if [[ -f "$EMAIL_FILE" ]]; then
EMAIL=$(cat $EMAIL_FILE)
if [[ -n "$email_override" ]]; then
EMAIL=$email_override
echo "$email_override" > $EMAIL_FILE
else
printf "Hello 👋 Welcome to Faros Community Edition! 🤗\n\n"
printf "Want to stay up to date with the latest community news? (we won't spam you)\n"
email_prompt
echo "$EMAIL" > $EMAIL_FILE
if [[ -f "$EMAIL_FILE" ]]; then
EMAIL=$(cat $EMAIL_FILE)
else
printf "Hello 👋 Welcome to Faros Community Edition! 🤗\n\n"
printf "Want to stay up to date with the latest community news? (we won't spam you)\n"
email_prompt
echo "$EMAIL" > $EMAIL_FILE
fi
fi

export FAROS_EMAIL=$EMAIL
Expand Down

0 comments on commit 685cd2a

Please sign in to comment.