Skip to content

Commit

Permalink
Actually move repo contents for building
Browse files Browse the repository at this point in the history
  • Loading branch information
AnActualEmerald committed Aug 22, 2024
1 parent 82ad332 commit 5872d7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
act latest
Binary file modified bun.lockb
100644 → 100755
Binary file not shown.
11 changes: 10 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ const wrap = Bun.env.TS_WRAP;
const repo = Bun.env.TS_REPO ?? "https://thunderstore.io";
const target_repo = Bun.env.TS_DEV?.toLowerCase() === "true" ? "https://thunderstore.dev" : repo;

const moveDirContents = async (from: string, to: string) => {
const files = await fs.readdir(from);
for(const file of files) {
Bun.spawnSync(["mv", p.join(from, file), p.join(to, file)]);
}
}

const publish = async (target: string, file: string | undefined) => {
console.log("::group::Publish package");
const args = file ? ["--file", file] : [];
Expand Down Expand Up @@ -53,11 +60,13 @@ if(Bun.env.TS_FILE) {

// Move files to where they're expected
console.log("::group::Set up environment");
const path = Bun.env.TS_PATH ? p.normalize(Bun.env.TS_PATH) : p.join(process.cwd(), "*");
const path = Bun.env.TS_PATH ? p.normalize(Bun.env.TS_PATH) : process.cwd();
console.log("Moving files from", path, "to /dist");

// Create the dist dir
await fs.mkdir("/dist");
await moveDirContents(path, "/dist");

Bun.spawnSync(["mv", path, "/dist"]);
await Bun.spawn(["ls", "/dist"]).exited;

Expand Down

0 comments on commit 5872d7d

Please sign in to comment.