mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-10 01:08:07 +01:00
fix: slice dep versions only if starts with ^
This commit is contained in:
parent
aa1d58aca2
commit
8f9f0ed87e
2 changed files with 14 additions and 4 deletions
|
@ -1,14 +1,20 @@
|
||||||
import { spawnSync } from "bun";
|
import { spawnSync } from "bun";
|
||||||
import { dependencies } from "../package.json";
|
import { dependencies } from "../package.json";
|
||||||
|
import { sliceIfStartsWith } from "./util.ts";
|
||||||
|
|
||||||
export const COMMIT_HASH = spawnSync({
|
export const COMMIT_HASH = spawnSync({
|
||||||
cmd: ["git", "log", "--pretty=format:%h", "-n", "1"],
|
cmd: ["git", "log", "--pretty=format:%h", "-n", "1"],
|
||||||
}).stdout.toString();
|
}).stdout.toString();
|
||||||
|
|
||||||
export const LILYBIRD_VERSION = dependencies.lilybird.slice(1);
|
export const LILYBIRD_VERSION = sliceIfStartsWith(dependencies.lilybird, "^");
|
||||||
export const LILYBIRD_JSX_VERSION = dependencies["@lilybird/jsx"].slice(1);
|
export const LILYBIRD_JSX_VERSION = sliceIfStartsWith(
|
||||||
export const LILYBIRD_HANDLERS_VERSION =
|
dependencies["@lilybird/jsx"],
|
||||||
dependencies["@lilybird/handlers"].slice(1);
|
"^"
|
||||||
|
);
|
||||||
|
export const LILYBIRD_HANDLERS_VERSION = sliceIfStartsWith(
|
||||||
|
dependencies["@lilybird/handlers"],
|
||||||
|
"^"
|
||||||
|
);
|
||||||
|
|
||||||
export const PRODUCTION = process.env.NODE_ENV === "production";
|
export const PRODUCTION = process.env.NODE_ENV === "production";
|
||||||
|
|
||||||
|
|
|
@ -42,3 +42,7 @@ export function isBunOnlyLikeMessage(content?: string) {
|
||||||
export function getRandomBunEmoji() {
|
export function getRandomBunEmoji() {
|
||||||
return BUN_EMOJIS[Math.floor(Math.random() * BUN_EMOJIS.length)];
|
return BUN_EMOJIS[Math.floor(Math.random() * BUN_EMOJIS.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sliceIfStartsWith(input: string, startsWith: string) {
|
||||||
|
return input.startsWith(startsWith) ? input.slice(startsWith.length) : input;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue