From 70d1e88a02d8622f2ba232e6c1c685a921ad246a Mon Sep 17 00:00:00 2001 From: AlpinDale Date: Tue, 18 Apr 2023 19:17:01 +0430 Subject: [PATCH] Added a linux start script --- readme.md | 5 +++++ start.sh | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 start.sh diff --git a/readme.md b/readme.md index 145bd5cbf..8f09e0c0e 100644 --- a/readme.md +++ b/readme.md @@ -106,12 +106,17 @@ https://rentry.org/TAI_Termux *NOTE: This branch is intended for local install purposes, and has not been thoroughly tested on a colab or other cloud notebook service.* +### Windows 1. install [NodeJS](https://nodejs.org/en) 2. download the zip from this GitHub repo 3. unzip it into a folder of your choice 4. run start.bat via double-clicking or in a command line. 5. Once the server has prepared everything for you, it will open a tab in your browser. +### Linux + 1. Run the `start.sh` script. + 2. Enjoy. + ## Remote connections Most often this is for people who want to use SillyTavern on their mobile phones while at home. diff --git a/start.sh b/start.sh new file mode 100755 index 000000000..b6a254e8b --- /dev/null +++ b/start.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if ! command -v npm &> /dev/null +then + read -p "npm is not installed. Do you want to install nodejs and npm? (y/n)" choice + case "$choice" in + y|Y ) + echo "Installing nvm..." + export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash + source ~/.bashrc + nvm install node;; + n|N ) + echo "Nodejs and npm will not be installed." + exit;; + * ) + echo "Invalid option. Nodejs and npm will not be installed." + exit;; + esac +fi + +npm i +node server.js +