Skip to content

Commit

Permalink
fix: Fixing Build (#15)
Browse files Browse the repository at this point in the history
- Checking if file exists before deleting it
- Unignoring src.index.ts, so we can delete it... will have follow up PR to ignore it
  • Loading branch information
incutonez authored Sep 23, 2024
1 parent e42e9b1 commit 82a53cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ src/assets/index.ts
src/components/index.ts
src/utils/index.ts
src/types/index.ts
src/index.ts
6 changes: 4 additions & 2 deletions makeIndex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writeFileSync } from "fs";
import { glob } from "glob";
import { rmSync } from "node:fs";
import { existsSync, rmSync } from "node:fs";
import path from "path";

const Dirs = [{
Expand All @@ -24,7 +24,9 @@ const SrcRe = /^src/;
const mainIndex: string[] = [];
for (const { dir, match, name } of Dirs) {
const output: string[] = [];
rmSync(`${dir}/index.ts`);
if (existsSync(`${dir}/index.ts`)) {
rmSync(`${dir}/index.ts`);
}
const files = glob.sync(`${dir}${match}`);
for (const file of files) {
const extension = path.extname(file);
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts

This file was deleted.

0 comments on commit 82a53cc

Please sign in to comment.