diff --git a/packages/darkcord/prepare_darwin.sh b/packages/darkcord/prepare_darwin.sh new file mode 100644 index 0000000..2b115de --- /dev/null +++ b/packages/darkcord/prepare_darwin.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Darwin version of prepare.bat + +# Script to check if the typings folder exists and compile the project, if the folder exists, delete it + +echo "Compiling..." + +if [ -d "typings" ]; then + # Delete typings folder + rm -rf typings +fi + +pnpm run c diff --git a/packages/darkcord/scripts/prepare.js b/packages/darkcord/scripts/prepare.js index 9e10aeb..2bbeae6 100644 --- a/packages/darkcord/scripts/prepare.js +++ b/packages/darkcord/scripts/prepare.js @@ -5,6 +5,8 @@ const { performance } = require("node:perf_hooks"); let scriptFile; if (process.platform === "win32") { scriptFile = "prepare.bat"; +} else if (process.platform === "darwin") { + scriptFile = "./prepare_darwin.sh"; } else { scriptFile = "./prepare.sh"; } @@ -26,14 +28,14 @@ prepare.stdout.on("data", (buffer) => { } if (message.includes("Compiling...")) { - console.log("\033[34minfo\x1b[0m Compiling typescript files..."); + console.log("\x1b[34minfo\x1b[0m Compiling typescript files..."); } if (message.includes("tscpaths")) { if (replaced === 2) { - console.log("\033[34minfo\x1b[0m Resolving import maps in dist..."); + console.log("\x1b[34minfo\x1b[0m Resolving import maps in dist..."); } else if (replaced === 1) { - console.log("\033[34minfo\x1b[0m Resolving import maps in typings..."); + console.log("\x1b[34minfo\x1b[0m Resolving import maps in typings..."); } replaced++;