diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/PVEDiscordDark/requirements.txt b/PVEDiscordDark/requirements.txt new file mode 100644 index 0000000..ff42cf2 --- /dev/null +++ b/PVEDiscordDark/requirements.txt @@ -0,0 +1,2 @@ +libsass +watchdog diff --git a/README.md b/README.md index 57186e2..3581ebc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,48 @@ +# Develop Branch - +## Setting up a development environment: +1. Clone this repository/branch +```shellsession +$ git clone https://github.com/b-/PVEThemes -b develop +$ cd PVEThemes/PVEDiscordDark +``` +2. Make sure you have python3-pip and python3-venv installed. (python3-wheel is recommended as well). This command will be a little different if you're not doing this development on a Debian or Ubuntu machine. +```shellsession +$ sudo apt update && sudo apt install python3-pip python3-wheel python3-venv +``` +3. Create and activate a Python venv, and install the requirements +```shellsession +$ python3 -m venv venv +$ . venv/bin/activate +(venv) $ python3 -m pip install -r requirements.txt +Collecting libsass + Downloading libsass-0.22.0-cp37-abi3-macosx_10_15_x86_64.whl (1.1 MB) + |████████████████████████████████| 1.1 MB 599 kB/s +Collecting watchdog + Downloading watchdog-2.2.1-cp39-cp39-macosx_10_9_x86_64.whl (88 kB) + |████████████████████████████████| 88 kB 8.1 MB/s +Installing collected packages: watchdog, libsass +Successfully installed libsass-0.22.0 watchdog-2.2.1 +``` +4. Now you can build the css +```shellsession +(venv) $ python3 sassy.py +Compiled PVEDiscordDark.sass to PVEDiscordDark.css +``` +5. If you want to automatically recompile it upon any changes: +```shellsession +(venv) $ python3 sassy.py w +``` +6. If you want to serve a test page: +(TODO: figure out how that works) +7. You can install a built copy right from the dev environment if you're brave enough to work on this on your actual proxmox server: +```shellsession +$ sudo ./install.sh install +``` +or +```shellsession +$ sudo ./install.sh update +``` ![](https://i.imgur.com/SnlCyHF.png) diff --git a/PVEDiscordDark.sh b/install.sh similarity index 97% rename from PVEDiscordDark.sh rename to install.sh index 624c023..a66d0ec 100644 --- a/PVEDiscordDark.sh +++ b/install.sh @@ -14,9 +14,12 @@ CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' TEMPLATE_FILE="/usr/share/pve-manager/index.html.tpl" SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/" +# TODO: Remove trailing / and change all "${SCRIPTDIR}/" +# to "${SCRIPTDIR}" SCRIPTPATH="${SCRIPTDIR}$(basename "${BASH_SOURCE[0]}")" -OFFLINEDIR="${SCRIPTDIR}offline" +OFFLINEDIR="${SCRIPTDIR}" +OFFLINECHECKDIR="${SCRIPTDIR}meta" REPO=${REPO:-"Weilbyte/PVEDiscordDark"} DEFAULT_TAG="master" @@ -42,8 +45,8 @@ hash pveversion 2>/dev/null || { exit 1; } -if test -d "$OFFLINEDIR"; then - echo "Offline directory detected, entering offline mode." +if test -d "$OFFLINECHECKDIR"; then + echo "${OFFLINECHECKDIR} directory detected, entering offline mode." OFFLINE=true else hash curl 2>/dev/null || {