Skip to content

Commit

Permalink
completely remove globs since we never used it
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Aug 5, 2024
1 parent 8d42dbb commit c9bafbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 101 deletions.
10 changes: 5 additions & 5 deletions functions/pushToGitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { readFileSync } from "fs";
import { normalize, relative } from "path";

import { Octokit } from "@octokit/rest";
import glob from "fast-glob";
import walkSync from "@helpers/walkSync";

/**
* Premade function for pushing directly to GitHub
Expand All @@ -28,12 +28,12 @@ export default async function pushToGitHub(
const octo = new Octokit({ auth: process.env.GIT_TOKEN });

const currentCommit = await getCurrentCommit(octo, org, repo, branch);
const filesPaths = await glob(localPath);
if (!filesPaths) return;
const filePaths = walkSync(localPath);
if (!filePaths) return;

// suspected problem on createBlobForFile which fails and give undefined
const filesBlobs = await Promise.all(filesPaths.map(createBlobForFile(octo, org, repo)));
const pathsForBlobs = filesPaths.map((fullPath) =>
const filesBlobs = await Promise.all(filePaths.map(createBlobForFile(octo, org, repo)));
const pathsForBlobs = filePaths.map((fullPath) =>
normalize(relative(localPath, fullPath)).replace(/\\/g, "/"),
);
const newTree = await createNewTree(
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"cron": "^3.1.7",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"fast-glob": "^3.3.2",
"gif-encoder-2": "^1.0.5",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0"
Expand Down
95 changes: 0 additions & 95 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c9bafbc

Please sign in to comment.