Skip to content

Commit ecfa940

Browse files
authored
Merge pull request #15 from avinassh/main-install
Move the installation instructions to main function
2 parents feb50e4 + a1c40b4 commit ecfa940

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

install.sh

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,27 @@ install_libsql_server() {
170170
rm -f $LIBSQL_DOWNLOAD_FILE
171171
}
172172

173-
printf "\nWelcome to the Turso installer!\n"
174-
175-
print_logo
176-
probe_arch
177-
probe_os
178-
179-
INSTALL_DIRECTORY="$HOME/.turso"
180-
install_libsql_server
181-
install_turso_cli
182-
update_profile
183-
184-
printf "\nTurso CLI installed!\n\n"
185-
printf "If you are a new user, you can sign up with ${bright_blue}turso auth signup${reset}.\n\n"
186-
printf "If you already have an account, please login with ${bright_blue}turso auth login${reset}.\n\n"
173+
# do everything in main, so that partial downloads of this file don't mess up the installation
174+
main() {
175+
printf "\nWelcome to the Turso installer!\n"
176+
177+
print_logo
178+
probe_arch
179+
probe_os
180+
181+
INSTALL_DIRECTORY="$HOME/.turso"
182+
install_libsql_server
183+
install_turso_cli
184+
update_profile
185+
186+
printf "\nTurso CLI installed!\n\n"
187+
printf "If you are a new user, you can sign up with ${bright_blue}turso auth signup${reset}.\n\n"
188+
printf "If you already have an account, please login with ${bright_blue}turso auth login${reset}.\n\n"
189+
190+
# if TURSO_INSTALL_SKIP_SIGNUP is set, then skip the sign up command
191+
if [ -z "$TURSO_INSTALL_SKIP_SIGNUP" ]; then
192+
$INSTALL_DIRECTORY/turso auth signup
193+
fi
194+
}
187195

188-
# if TURSO_INSTALL_SKIP_SIGNUP is set, then skip the sign up command
189-
if [ -z "$TURSO_INSTALL_SKIP_SIGNUP" ]; then
190-
$INSTALL_DIRECTORY/turso auth signup
191-
fi
196+
main

0 commit comments

Comments
 (0)