mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-31 15:37:49 +00:00
better scripts for unix development
This commit is contained in:
1 parent
5cb8f5b93a
commit
f1d14ab73f
2 files changed
+56
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# This works on Linux and MacOS to launch the frontend dev server
|
||||
|
||||
root_dir=$(pwd)
|
||||
frontend_path="${root_dir}/frontend"
|
||||
|
||||
echo "Running Artcraft Frontend in Dev Mode..."
|
||||
echo ""
|
||||
|
||||
echo "You'll need to launch the Rust dev server as a second script!"
|
||||
echo ""
|
||||
|
||||
# Kill any process running on port 5741, which will block startup
|
||||
if lsof -i tcp:5173 &>/dev/null; then
|
||||
lsof -i tcp:5173 -t | xargs kill -9
|
||||
echo "Killed process running on port 5173"
|
||||
else
|
||||
echo "No process running on port 5173"
|
||||
fi
|
||||
|
||||
pushd "${frontend_path}" || exit
|
||||
|
||||
npm install
|
||||
|
||||
nx dev editor3d
|
||||
|
||||
popd || exit
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# This works on Linux and MacOS to launch the Rust dev server
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
echo "Running Artcraft Rust in Dev Mode..."
|
||||
echo ""
|
||||
|
||||
echo "You'll need to launch the frontend dev server as a second script!"
|
||||
echo ""
|
||||
|
||||
root_dir=$(pwd)
|
||||
frontend_path="${root_dir}/frontend"
|
||||
rust_crate_path="${root_dir}/crates/desktop/artcraft"
|
||||
|
||||
# The tauri dev server integration is super annoying: It eats ctrl-c interrupts,
|
||||
# it decoheres the and corrupts terminal output, and it's slow. This configuration
|
||||
# allows us to start without it. Simply launch `nx` and the dev server as a separate
|
||||
# process and leave tauri out of the loop
|
||||
config_path="${rust_crate_path}/tauri.artcraft_3d.no_dev.conf.toml"
|
||||
|
||||
export TAURI_FRONTEND_PATH="${frontend_path}"
|
||||
export TAURI_APP_PATH="${rust_crate_path}"
|
||||
|
||||
RUSTFLAGS="-Awarnings" cargo tauri dev \
|
||||
--no-dev-server \
|
||||
--no-dev-server-wait \
|
||||
--no-watch \
|
||||
--config "${config_path}"
|
||||
Reference in new issue
Block a user