- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
65 additions
and
99 deletions.
There are no files selected for viewing
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,63 @@ | ||
@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 | ||
|
||
:: Function to install using PowerShell | ||
CALL :install_with_powershell | ||
|
||
:: 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 |
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
This file was deleted.
Oops, something went wrong.
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