added screen/tmux support
This commit is contained in:
@@ -32,7 +32,8 @@ Download and install [Node.js](https://nodejs.org/en/)
|
|||||||
<summary><b>Mac/Linux Screen</b></summary>
|
<summary><b>Mac/Linux Screen</b></summary>
|
||||||
<br>
|
<br>
|
||||||
<p>Screen allows the bot to run in the background without a terminal present</p>
|
<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>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>Mac</p>
|
<p>Mac</p>
|
||||||
@@ -54,7 +55,8 @@ Download and install [Node.js](https://nodejs.org/en/)
|
|||||||
<summary><b>Mac/Linux Tmux</b></summary>
|
<summary><b>Mac/Linux Tmux</b></summary>
|
||||||
<br>
|
<br>
|
||||||
<p>Tmux allows the bot to run in the background without a terminal present</p>
|
<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>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>Mac</p>
|
<p>Mac</p>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"start": "node .",
|
"start": "node .",
|
||||||
"watch": "npm-watch",
|
"watch": "npm-watch",
|
||||||
"dev": "npm-watch"
|
"dev": "npm-watch",
|
||||||
|
"getname": "echo $npm_package_name"
|
||||||
},
|
},
|
||||||
"watch": {
|
"watch": {
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
12
scripts/mac-linux/start_screen
Executable file
12
scripts/mac-linux/start_screen
Executable 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
12
scripts/mac-linux/start_tmux
Executable 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
|
||||||
Reference in New Issue
Block a user