-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_all.bat
More file actions
42 lines (35 loc) · 1.94 KB
/
Copy pathsetup_all.bat
File metadata and controls
42 lines (35 loc) · 1.94 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
setlocal
cd /d "%~dp0"
title First-time Setup (uploader + crawler)
set "PATH=%USERPROFILE%\.local\bin;%PATH%"
echo [1/6] Fetching latest code...
git pull origin main
where uv >nul 2>&1
if errorlevel 1 (
echo [2/6] Installing uv package manager...
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
set "PATH=%USERPROFILE%\.local\bin;%PATH%"
) else (
echo [2/6] uv already installed.
)
echo [3/6] Removing old virtual environments...
if exist "product-info-crawler\.venv" rmdir /s /q "product-info-crawler\.venv"
if exist "product-auto-uploader\.venv" rmdir /s /q "product-auto-uploader\.venv"
echo [4/6] Setting up uploader...
pushd "product-auto-uploader"
uv sync
uv run playwright install chromium
popd
echo [5/6] Setting up crawler...
pushd "product-info-crawler"
uv sync
popd
echo [6/6] Creating desktop shortcuts...
powershell -NoProfile -ExecutionPolicy Bypass -Command "$n=-join([char[]](0xC0C1,0xD488,0x20,0xC790,0xB3D9,0xB4F1,0xB85D)); $W=New-Object -ComObject WScript.Shell; $lnk=Join-Path ([Environment]::GetFolderPath('Desktop')) ($n+'.lnk'); $S=$W.CreateShortcut($lnk); $S.TargetPath=('%~dp0product-auto-uploader\'+([char]0xC2E4+[char]0xD589)+'.bat'); $S.WorkingDirectory='%~dp0product-auto-uploader'; $S.IconLocation=($env:SystemRoot+'\System32\imageres.dll,174'); $S.Save(); Write-Host (' '+$lnk)"
powershell -NoProfile -ExecutionPolicy Bypass -Command "$n=-join([char[]](0xC0C1,0xD488,0x20,0xC815,0xBCF4,0x20,0xC218,0xC9D1)); $W=New-Object -ComObject WScript.Shell; $lnk=Join-Path ([Environment]::GetFolderPath('Desktop')) ($n+'.lnk'); $S=$W.CreateShortcut($lnk); $S.TargetPath=('%~dp0product-info-crawler\'+([char]0xC2E4+[char]0xD589)+'.bat'); $S.WorkingDirectory='%~dp0product-info-crawler'; $S.IconLocation=($env:SystemRoot+'\System32\imageres.dll,171'); $S.Save(); Write-Host (' '+$lnk)"
echo.
echo Done. Two icons are on the Desktop. Double-click them to run.
echo.
pause
endlocal