-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refine tman frontend build process
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( | ||
cd "$(dirname "$0")" || exit | ||
pwd | ||
) | ||
|
||
PROJECT_ROOT_DIR=$( | ||
cd "$SCRIPT_DIR/.." || exit | ||
pwd | ||
) | ||
|
||
# Change to `frontend` folder and build the frontend. | ||
echo "Building frontend..." | ||
cd "$PROJECT_ROOT_DIR/frontend" || exit 1 | ||
npm install || exit 1 | ||
npm run build || exit 1 | ||
|
||
# Change back to the project root folder. | ||
cd "$PROJECT_ROOT_DIR" || exit 1 | ||
|
||
# Build tman rust project. | ||
echo "Building ..." | ||
cargo build --release || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( | ||
cd "$(dirname "$0")" || exit | ||
pwd | ||
) | ||
|
||
PROJECT_ROOT_DIR=$( | ||
cd "$SCRIPT_DIR/.." || exit | ||
pwd | ||
) | ||
|
||
# 檢查是否提供了參數 | ||
if [ -z "$1" ]; then | ||
echo "Error: Missing base directory argument." | ||
echo "Usage: $0 <base-dir>" | ||
exit 1 | ||
fi | ||
|
||
BASE_DIR=$1 | ||
|
||
# Change to `frontend` folder and build the frontend. | ||
echo "Building frontend..." | ||
cd "$PROJECT_ROOT_DIR/frontend" || exit 1 | ||
npm install || exit 1 | ||
npm run build || exit 1 | ||
|
||
# Change back to the project root folder. | ||
cd "$PROJECT_ROOT_DIR" || exit 1 | ||
|
||
# Build tman rust project. | ||
echo "Building and running tman dev-server ..." | ||
cargo run dev-server --base-dir="$BASE_DIR" |