Skip to content

Commit

Permalink
Merge branch 'main' into renovate/appleboy-ssh-action-1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoToast authored Sep 16, 2023
2 parents ef222a0 + 1495bfa commit 4a236e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/commands/util/status.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dayjs, { extend } from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { JukebotGlobals } from '../../global';
import { commitHash } from '../../global/commitHash';
import { Colours, Command } from '../../types';

extend(relativeTime);
Expand All @@ -25,12 +26,10 @@ export const statusCommand: Command = {
const utilizedMemory = process.memoryUsage().heapUsed / 1024 ** 2;

const output: string[] = [
`${Colours.Bright}Jukebot ${Colours.Reset}${Colours.FgRed}${JukebotGlobals.version}${Colours.Reset} ${observer.currentVersionTip}`,
`Uptime: ${Colours.FgGreen}${uptime[0].toUpperCase() + uptime.slice(1)}${Colours.Reset} ${
Colours.FgBlack
`${Colours.Bright}Jukebot ${Colours.Reset}${Colours.FgRed}${JukebotGlobals.version}${Colours.Reset} ${observer.currentVersionTip} ${Colours.FgBlack}${commitHash.slice(0, 7)}${Colours.Reset}`,
`Uptime: ${Colours.FgGreen}${uptime[0].toUpperCase() + uptime.slice(1)}${Colours.Reset} ${Colours.FgBlack
}${new Date(client.readyAt).toLocaleString('en-NZ')} NZT${Colours.Reset}`,
`Latency: ${Colours.FgYellow}${ping}ms (${pingHint(ping)})${Colours.Reset} API Latency: ${
Colours.FgBlue
`Latency: ${Colours.FgYellow}${ping}ms (${pingHint(ping)})${Colours.Reset} API Latency: ${Colours.FgBlue
}${apiLatency}ms${Colours.Reset}`,
`Memory: ${Colours.FgCyan}${Math.ceil(utilizedMemory)}${Colours.Reset} MB`,
];
Expand Down
3 changes: 3 additions & 0 deletions src/global/commitHash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { execSync } from 'child_process';

export const commitHash = execSync('git rev-parse HEAD').toString().trim()
2 changes: 2 additions & 0 deletions src/global/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { commitHash } from './commitHash';
import { config } from './config';
import { devmode } from './devmode';
import { startTime } from './startTime';
import { version } from './version';

export const JukebotGlobals = {
commitHash,
config,
devmode,
startTime,
Expand Down

0 comments on commit 4a236e3

Please sign in to comment.