Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit 99bfa63036499901310c43baabf51e5bac03b797
parent 43ec71bae64fbdda94d78f5868f8b42a8d60677e
Author: Demonstrandum <moi@knutsen.co>
Date:   Mon, 18 May 2020 01:34:49 +0100

Move nocheckout clone to main.

Diffstat:
MProcfile | 2+-
Mclone_nocheckout.sh | 2++
Mlib/main.ts | 7++++++-
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Procfile b/Procfile @@ -1,3 +1,3 @@ # Keep alive, lol. -worker: source clone_nocheckout.sh; while true; do curl 'simp-o-matic.herokuapp.com' & sleep 300; done +worker: while true; do curl 'simp-o-matic.herokuapp.com' & sleep 300; done web: yarn start diff --git a/clone_nocheckout.sh b/clone_nocheckout.sh @@ -1,5 +1,7 @@ #!/bin/sh +rm -rf ./tmp ./.git + git clone \ --no-checkout \ https://github.com/Demonstrandum/Simp-O-Matic.git \ diff --git a/lib/main.ts b/lib/main.ts @@ -14,7 +14,7 @@ import { writeFileSync as write_file, readdirSync as read_dir } from 'fs'; -import { execSync as shell } from 'child_process'; +import { execSync as shell, exec } from 'child_process'; // Local misc/utility functions. import './extensions'; @@ -133,6 +133,11 @@ export class SimpOMatic { logged_in.then(() => console.log('Bot logged in.')); client.on('ready', () => this.events()); + // Clone local `.git'. + exec('./clone_nocheckout.sh', { + cwd: process.cwd() + }); + return this._CLIENT; }