Skip to content

Commit

Permalink
feat: git pull
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev authored Nov 26, 2023
1 parent 2a0396d commit 75c104e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 37 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Deploy
run: curl -X POST ${{ secrets.WEBHOOK }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Other
src/config.ts
32 changes: 32 additions & 0 deletions src/config.example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ColorResolvable } from "discord.js";

const embeds = {
default: "#0096FF" as ColorResolvable,
error: "#E74C3C" as ColorResolvable
}

const emojis = {
connection_bad: "",
connection_excellent: "",
connection_good: "",
cross: "",
ping: "",
reply: "",
tick: ""
}

const main = {
owner: ""
}

export {
embeds,
emojis,
main
}

export default {
embeds,
emojis,
main
}
33 changes: 0 additions & 33 deletions src/config.ts

This file was deleted.

13 changes: 12 additions & 1 deletion src/events/client/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Event from "../../classes/Event";
import ExtendedClient from "../../classes/ExtendedClient";

import Discord from "discord.js";

import { exec } from "child_process";
import globalCommands from "../../scripts/global-commands";

import Reminder from "../../models/Reminder";
Expand All @@ -18,6 +18,17 @@ const event: Event = {
// Register Commands
await globalCommands(client);

// Automatic Git Pull
setInterval(() => {
exec("git pull", (err: any, stdout: any) => {
if(err) return console.log(err);
if(stdout.includes("Already up to date.")) return;

console.log(stdout);
process.exit();
})
}, 30 * 1000) // 30 seconds

// Manage timeouts
let reminders = await Reminder.find({});

Expand Down

0 comments on commit 75c104e

Please sign in to comment.