Skip to content

Commit

Permalink
feat: added darwin support to build
Browse files Browse the repository at this point in the history
  • Loading branch information
liy77 committed Mar 17, 2024
1 parent f852d7d commit f3c7278
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions packages/darkcord/prepare_darwin.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions packages/darkcord/scripts/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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++;
Expand Down

0 comments on commit f3c7278

Please sign in to comment.