Skip to content

fix: cross-platform compatibility for build scripts #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
],
ignorePatterns: [".eslintrc.cjs", "test", "docs", "dist"],
ignorePatterns: [".eslintrc.cjs", "test", "docs", "dist","moveFiles.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
Expand Down
34 changes: 34 additions & 0 deletions moveFiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { fileURLToPath } from "url";
import path from "path";
import fs from "fs-extra";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

async function moveDirectories() {
try {
const srcReact = path.join(__dirname, "distreact", "react");
const destReact = path.join(__dirname, "dist", "react");

const srcNextjs = path.join(__dirname, "distnextjs", "nextjs");
const destNextjs = path.join(__dirname, "dist", "nextjs");

if (await fs.pathExists(srcReact)) {
await fs.move(srcReact, destReact, { overwrite: true });
console.log("Moved React directory.");
}

if (await fs.pathExists(srcNextjs)) {
await fs.move(srcNextjs, destNextjs, { overwrite: true });
console.log("Moved Next.js directory.");
}

await fs.remove(path.join(__dirname, "distreact"));
await fs.remove(path.join(__dirname, "distnextjs"));
console.log("Cleaned up source directories.");
} catch (err) {
console.error("Error moving directories:", err);
}
}

moveDirectories();
Loading