init and some qol stuff for a modpack maker

This commit is contained in:
Joey Eamigh
2023-06-20 20:54:41 -04:00
commit 1160a10a3a
15 changed files with 460 additions and 0 deletions

46
client/client.ps1 Normal file
View File

@@ -0,0 +1,46 @@
# check if winget is installed and if so, set a flag to true
$winget = Get-Command winget -ErrorAction SilentlyContinue
if (!$winget) {
Write-Host "Error: winget is not installed." -Foreground Red
Write-Host "This script may not work withotu winget." -Foreground Red
Write-Host "Run 'Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' in an admin powershell prompt to install winget." -Foreground Red
}
# Check that python is installed
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
Write-Host "Error: python is not installed." -Foreground Red
if ($winget) {
Write-Host "Attempting to install python."
winget install --id=Python.Python.3.11 -e
}
else {
Write-Host "Please install python to continue." -Foreground Red
exit 1
}
}
# Check that java is installed
if (-not (Get-Command "java" -ErrorAction SilentlyContinue)) {
Write-Host "Error: java is not installed." -Foreground Red
if ($winget) {
Write-Host "Attempting to install java."
winget install AdoptOpenJDK.OpenJDK.11
}
else {
Write-Host "Please install java to continue." -Foreground Red
exit 1
}
}
if (Test-Path ".venv") { } else { python -m venv .venv }
.venv\Scripts\Activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python .\client.py

3
client/client.py Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env python3
DOWNLOADER_URL = "https://github.com/North-West-Wind/CurseForge-CLI/releases/latest/download/curseforge.zip"

22
client/client.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# check that python is installed
if ! [ -x "$(command -v python)" ]; then
echo 'Error: python is not installed. Please install it to continue.' >&2
exit 1
fi
# check that java is installed
if ! [ -x "$(command -v java)" ]; then
echo 'Error: java is not installed. Please install it to continue.' >&2
exit 1
fi
if [ -d .venv ]; then; else python -m venv .venv; fi
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python ./client.py

5
client/requirements.txt Normal file
View File

@@ -0,0 +1,5 @@
certifi==2023.5.7
charset-normalizer==3.1.0
idna==3.4
requests==2.31.0
urllib3==2.0.3