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> <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>

View File

@@ -1,43 +1,44 @@
{ {
"name": "1800queue", "name": "1800queue",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"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": {
"build": {
"patterns": [
"src"
],
"extensions": "ts",
"legacyWatch": true
}, },
"start": { "watch": {
"patterns": [ "build": {
"dist" "patterns": [
], "src"
"extensions": "js", ],
"legacyWatch": true, "extensions": "ts",
"runOnChangeOnly": true "legacyWatch": true
},
"start": {
"patterns": [
"dist"
],
"extensions": "js",
"legacyWatch": true,
"runOnChangeOnly": true
}
},
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^17.0.13",
"npm-watch": "^0.11.0",
"ts-node": "^10.4.0",
"typescript": "^4.5.5"
},
"dependencies": {
"@discordjs/rest": "^0.3.0",
"cheerio": "^1.0.0-rc.10",
"discord-api-types": "^0.26.1",
"discord.js": "^13.6.0"
} }
},
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^17.0.13",
"npm-watch": "^0.11.0",
"ts-node": "^10.4.0",
"typescript": "^4.5.5"
},
"dependencies": {
"@discordjs/rest": "^0.3.0",
"cheerio": "^1.0.0-rc.10",
"discord-api-types": "^0.26.1",
"discord.js": "^13.6.0"
}
} }

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