added screen/tmux support

This commit is contained in:
2022-01-27 21:04:48 -06:00
parent 4f696e8b21
commit 219d3e55e7
4 changed files with 68 additions and 41 deletions

View File

@@ -32,7 +32,8 @@ Download and install [Node.js](https://nodejs.org/en/)
<summary><b>Mac/Linux Screen</b></summary>
<br>
<p>Screen allows the bot to run in the background without a terminal present</p>
<p>Installing</p>
<p><a href="https://linuxize.com/post/how-to-use-linux-screen/">Tutorial for usage</a>, check if it's installed already before installing</p>
<p><b>Installing</b></p>
<ul>
<li>
<p>Mac</p>
@@ -54,7 +55,8 @@ Download and install [Node.js](https://nodejs.org/en/)
<summary><b>Mac/Linux Tmux</b></summary>
<br>
<p>Tmux allows the bot to run in the background without a terminal present</p>
<p>Installing</p>
<p><a href="https://linuxize.com/post/getting-started-with-tmux/">Tutorial for usage</a>, check if it's installed already before installing</p>
<p><b>Installing</b></p>
<ul>
<li>
<p>Mac</p>

View File

@@ -7,7 +7,8 @@
"build": "tsc",
"start": "node .",
"watch": "npm-watch",
"dev": "npm-watch"
"dev": "npm-watch",
"getname": "echo $npm_package_name"
},
"watch": {
"build": {

12
scripts/mac-linux/start_screen Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
#change to ccurrent directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
#start
if [[ $(screen -ls | grep $(npm run getname -s)) ]]; then
echo "Session already exists"
else
screen -S $(npm run getname -s) -d -m ./start
echo "Created session"
fi

12
scripts/mac-linux/start_tmux Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
#change to ccurrent directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
#start
if [[ $(tmux ls | grep $(npm run getname -s)) ]]; then
echo "Session already exists"
else
tmux new-session -d -s $(npm run getname -s) ./start
echo "Created session"
fi