Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed Dec 23, 2024
1 parent 595061a commit 0102e59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 90 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ ENV DENO_NO_PROMPT=1
ENV DENO_NO_UPDATE_CHECK=1
COPY --from=stage-deno /deno /opt/denoland/deno/deno
RUN chmod +x /opt/denoland/deno/deno && ln -s /opt/denoland/deno/deno /usr/bin/deno
COPY _color_namespace_list.ts _fswalk.ts _payload.ts _random_integer.ts deno.jsonc mod.ts ${APP_ROOT}/
COPY _color_namespace_list.ts _payload.ts _random_integer.ts deno.jsonc mod.ts ${APP_ROOT}/
RUN deno --version && deno info && cd $APP_ROOT && deno install --lock --vendor --entrypoint mod.ts
CMD deno run --allow-env --allow-net=discord.com --allow-read --allow-write --config=$APP_ROOT/deno.jsonc --lock --vendor $APP_ROOT/mod.ts
67 changes: 0 additions & 67 deletions _fswalk.ts

This file was deleted.

35 changes: 14 additions & 21 deletions _payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Color from "COLOR";
import {
walk,
type FSWalkEntry
} from "FS/walk.ts";
import {
isJSONArray,
isJSONObject,
Expand All @@ -16,10 +20,6 @@ import { globToRegExp } from "STD/path/glob-to-regexp";
import { join as pathJoin } from "STD/path/join";
import type { StringTruncator } from "STRINGOVERFLOW/mod.ts";
import { colorNamespaceList } from "./_color_namespace_list.ts";
import {
walkFS,
type FSWalkEntry
} from "./_fswalk.ts";
import { generateRandomInteger } from "./_random_integer.ts";
const thresholdContent = 2000;
const thresholdEmbeds = 10;
Expand Down Expand Up @@ -362,29 +362,22 @@ async function resolveFilesFormData(workspace: string, files: string[]): Promise
}
export async function resolveFiles(files: string[], glob: boolean): Promise<FormData | undefined> {
const workspace: string = getRunnerWorkspacePath();
const workspaceStat: Deno.FileInfo = await Deno.stat(workspace);
if (!workspaceStat.isDirectory) {
const workspaceStatL: Deno.FileInfo = await Deno.lstat(workspace);
if (!workspaceStatL.isDirectory) {
throw new Deno.errors.NotADirectory(`Workspace \`${workspace}\` is not a directory!`);
}
if (files.length === 0) {
return undefined;
}
if (glob) {
const matchers: RegExp[] = files.map((file: string): RegExp => {
return globToRegExp(file, { caseInsensitive: true });
});
const filesFmt: string[] = (await Array.fromAsync(walkFS(workspace, {
includeDirs: false,
includeRoot: false,
includeSymlinks: false
}))).filter(({
pathAbsolute,
pathRelative
}: FSWalkEntry): boolean => {
return pathAbsolute.startsWith(workspace) && matchers.some((matcher: RegExp): boolean => {
return matcher.test(pathRelative);
});
}).map(({ pathRelative }: FSWalkEntry): string => {
const filesFmt: string[] = await Array.fromAsync(await walk(workspace, {
includeDirectories: false,
includeSymlinkDirectories: false,
includeSymlinkFiles: false,
matches: files.map((file: string): RegExp => {
return globToRegExp(file, { caseInsensitive: true });
})
}), ({ pathRelative }: FSWalkEntry): string => {
return pathRelative;
});
if (filesFmt.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"COLOR": "https://esm.sh/color@4.2.3",
"COLORNAMESPACELISTCOMMUNITY": "https://esm.sh/color-name-list@10.28.0/dist/colornames.esm.js",
"EXFETCH/": "https://raw.githubusercontent.com/hugoalh/exfetch-es/v0.5.1/",
"FS/": "https://raw.githubusercontent.com/hugoalh/fs-es/v0.2.0/",
"GHACTIONS/": "https://raw.githubusercontent.com/hugoalh/github-actions-core-es/v0.4.2/",
"ISJSON/": "https://raw.githubusercontent.com/hugoalh/is-json-es/v1.0.4/",
"REGEXPURL": "https://esm.sh/url-regex-safe@4.0.0",
"STD/assert": "jsr:@std/assert@1.0.8",
"STD/fs": "jsr:@std/fs@1.0.6",
"STD/media-types": "jsr:@std/media-types@1.1.0",
"STD/path": "jsr:@std/path@1.0.8",
"STD/yaml": "jsr:@std/yaml@1.0.5",
Expand Down

0 comments on commit 0102e59

Please sign in to comment.