-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall_webdev_locally.sh
More file actions
executable file
·27 lines (23 loc) · 972 Bytes
/
Copy pathinstall_webdev_locally.sh
File metadata and controls
executable file
·27 lines (23 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
echo "Building the application..."
dotnet build --configuration Release --no-restore --self-contained false /p:PublishSingleFile=true /p:PublishTrimmed=true
# Create the zip file
echo "Creating webdev-tool.zip..."
cd ./bin/Release/net9.0 && zip -r ../../../webdev-tool.zip ./* && cd -
# Check if webdev-tool.zip exists
if [ ! -f "webdev-tool.zip" ]; then
echo "Error: webdev-tool.zip not found. Please ensure the build completed successfully."
exit 1
fi
# Install webdev tool on host first
echo "Installing webdev tool on host..."
mkdir ~/webdev-host_backup
cp -r ~/webdev-host/certs ~/webdev-host_backup/
cp -r ~/webdev-host/secrets ~/webdev-host_backup/
rm -rf ~/webdev-host
mkdir ~/webdev-host
cp -r ~/webdev-host_backup/certs ~/webdev-host/certs
cp -r ~/webdev-host_backup/secrets ~/webdev-host/secrets
unzip -o webdev-tool.zip -d ~/webdev-host/
chmod +x ~/webdev-host/webdev.sh
sudo ln -sf ~/webdev-host/webdev.sh /usr/local/bin/webdev