-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve install / update / run scripts
- Loading branch information
Showing
9 changed files
with
156 additions
and
3 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 @@ | ||
./macos_INSTALL.sh |
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 @@ | ||
./macos_START.sh |
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 @@ | ||
./macos_UPDATE.sh |
File renamed without changes.
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,93 @@ | ||
#!/bin/bash | ||
|
||
set -e # Exit with nonzero exit code if anything fails | ||
set -u # Treat unset variables as an error | ||
# set -x # Print commands and their arguments as they are executed | ||
|
||
# ===//=====//======//======//======//======//======//======//======//======//======//======//== | ||
# ==//=====//======//======//======//======//======//======//======//======//======//======//=== | ||
|
||
PNPM_VERSION=8.11.0 | ||
PNPM_HOME=$(pwd)/.cushy | ||
PNPM_BIN_PATH=$(pwd)/.cushy/pnpm | ||
|
||
# Function to install using curl | ||
install_with_curl() { | ||
echo "Installing pnpm with curl..." | ||
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=$PNPM_VERSION sh - | ||
} | ||
|
||
# Function to install using wget | ||
install_with_wget() { | ||
echo "Installing pnpm with wget..." | ||
wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=$PNPM_VERSION sh - | ||
} | ||
|
||
install_or_update_pnpm() { | ||
# Check if curl is available | ||
if command -v curl > /dev/null 2>&1; then | ||
install_with_curl | ||
# Check if wget is available | ||
elif command -v wget > /dev/null 2>&1; then | ||
install_with_wget | ||
# If neither curl nor wget is available, exit with error | ||
else | ||
echo "Neither curl nor wget is available. Please install one of these packages and try again." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Check if pnpm is already installed | ||
if command -v $PNPM_HOME/pnpm > /dev/null 2>&1; then | ||
INSTALLED_PNPM_VERSION=$($PNPM_BIN_PATH --version) | ||
|
||
if [ "$INSTALLED_PNPM_VERSION" != "$PNPM_VERSION" ]; then | ||
echo "⏳ Updating pnpm from version $INSTALLED_PNPM_VERSION to $PNPM_VERSION..." | ||
install_or_update_pnpm | ||
else | ||
echo "🟢 pnpm is already installed and up to date." | ||
fi | ||
else | ||
echo "⏳ pnpm is not installed, proceeding with installation..." | ||
install_or_update_pnpm | ||
fi | ||
|
||
# Verify pnpm installation | ||
if ! command -v $PNPM_BIN_PATH > /dev/null 2>&1; then | ||
echo "Failed to install or update pnpm." | ||
exit 1 | ||
fi | ||
|
||
# Install dependencies using pnpm | ||
echo "Installing dependencies..." | ||
$PNPM_BIN_PATH install | ||
|
||
# ===//=====//======//======//======//======//======//======//======//======//======//======//== | ||
# ==//=====//======//======//======//======//======//======//======//======//======//======//=== | ||
|
||
# ensuring binary dependencies are correctly linked across installed | ||
./node_modules/.bin/electron-builder install-app-deps | ||
|
||
|
||
# ===//=====//======//======//======//======//======//======//======//======//======//======//== | ||
# ==//=====//======//======//======//======//======//======//======//======//======//======//=== | ||
|
||
# Define the path to tsconfig.custom.json | ||
tsconfigPath="./tsconfig.custom.json" | ||
|
||
# JSON content to write if the file does not exist | ||
defaultTsconfigJSON='{ "include": ["src", "schema/global.d.ts"], "exclude": [] }' | ||
|
||
# Check if the file exists | ||
if [ ! -f "$tsconfigPath" ]; then | ||
# Write the JSON content to the file without formatting | ||
echo "$defaultTsconfigJSON" > "$tsconfigPath" | ||
fi | ||
|
||
|
||
# ===//=====//======//======//======//======//======//======//======//======//======//======//== | ||
# ==//=====//======//======//======//======//======//======//======//======//======//======//=== | ||
|
||
# Start Vite using Electron's Node | ||
echo "Starting Vite with Electron's Node..." | ||
./node_modules/.bin/electron -i src/shell |
File renamed without changes.
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
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,60 @@ | ||
@echo off | ||
SETLOCAL EnableExtensions | ||
setlocal enabledelayedexpansion | ||
|
||
:: Exit with nonzero exit code if anything fails | ||
set errorlevel= | ||
|
||
:: Define variables | ||
SET PNPM_VERSION=8.11.0 | ||
SET PNPM_HOME=%CD%\.cushy | ||
SET PNPM_BIN_PATH=%CD%\.cushy\pnpm.exe | ||
|
||
:: Check if pnpm is already installed | ||
IF EXIST "%PNPM_HOME%\pnpm" ( | ||
FOR /F "tokens=*" %%i IN ('%PNPM_BIN_PATH% --version') DO SET INSTALLED_PNPM_VERSION=%%i | ||
IF NOT "%INSTALLED_PNPM_VERSION%"=="%PNPM_VERSION%" ( | ||
ECHO Updating pnpm from version %INSTALLED_PNPM_VERSION% to %PNPM_VERSION%... | ||
CALL :install_with_powershell | ||
) ELSE ( | ||
ECHO pnpm is already installed and up to date. | ||
) | ||
) ELSE ( | ||
ECHO pnpm is not installed, proceeding with installation... | ||
CALL :install_with_powershell | ||
) | ||
|
||
:: Verify pnpm installation | ||
IF NOT EXIST "%PNPM_BIN_PATH%" ( | ||
ECHO Failed to install or update pnpm. | ||
EXIT /B 1 | ||
) | ||
|
||
:: Install dependencies using pnpm | ||
ECHO Installing dependencies... | ||
CALL %PNPM_BIN_PATH% install | ||
|
||
:: ensuring binary dependencies are correctly linked across installed | ||
CALL .\node_modules\.bin\electron-builder install-app-deps | ||
|
||
:: Define the path to tsconfig.custom.json | ||
SET tsconfigPath=.\tsconfig.custom.json | ||
|
||
:: JSON content to write if the file does not exist | ||
SET defaultTsconfigJSON={ "include": ["src", "schema/global.d.ts"], "exclude": [] } | ||
|
||
:: Check if the file exists | ||
IF NOT EXIST "%tsconfigPath%" ( | ||
ECHO %defaultTsconfigJSON% > "%tsconfigPath%" | ||
) | ||
|
||
:: Start Vite using Electron's Node | ||
ECHO Starting Vite with Electron's Node... | ||
CALL .\node_modules\.bin\electron -i src\shell | ||
|
||
EXIT /B 0 | ||
|
||
:install_with_powershell | ||
ECHO Installing pnpm with PowerShell... | ||
PowerShell -Command "iwr https://get.pnpm.io/install.ps1 -useb | iex" | ||
EXIT /B 0 |
File renamed without changes.