Do not push transient steps
All checks were successful
Build and test project / build-and-test (push) Successful in 1m30s
All checks were successful
Build and test project / build-and-test (push) Successful in 1m30s
This commit is contained in:
@@ -4,6 +4,11 @@ set -euo pipefail
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
KOBOPATCH_DIR="$SCRIPT_DIR/kobopatch-src"
|
KOBOPATCH_DIR="$SCRIPT_DIR/kobopatch-src"
|
||||||
|
|
||||||
|
if ! command -v go &>/dev/null; then
|
||||||
|
echo "Go not found, downloading..."
|
||||||
|
curl -fsSL https://go.dev/dl/go1.23.12.linux-amd64.tar.gz | tar -xz -C /usr/local
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "$KOBOPATCH_DIR" ]; then
|
if [ -d "$KOBOPATCH_DIR" ]; then
|
||||||
echo "Updating kobopatch source..."
|
echo "Updating kobopatch source..."
|
||||||
cd "$KOBOPATCH_DIR"
|
cd "$KOBOPATCH_DIR"
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ providers = ["node"]
|
|||||||
[phases.setup]
|
[phases.setup]
|
||||||
nixPkgs = ["git", "curl", "zip", "gnutar", "nginx"]
|
nixPkgs = ["git", "curl", "zip", "gnutar", "nginx"]
|
||||||
paths = ["/usr/local/go/bin"]
|
paths = ["/usr/local/go/bin"]
|
||||||
cmds = [
|
|
||||||
"curl -sSfL https://go.dev/dl/go1.23.12.linux-amd64.tar.gz | tar -xz -C /usr/local",
|
|
||||||
]
|
|
||||||
|
|
||||||
[phases.build]
|
[phases.build]
|
||||||
cmds = [
|
cmds = [
|
||||||
|
|||||||
8
test.sh
8
test.sh
@@ -3,6 +3,14 @@ set -euo pipefail
|
|||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
|
echo "=== Installing web dependencies ==="
|
||||||
|
cd "$SCRIPT_DIR/web" && npm install
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Building web app ==="
|
||||||
|
cd "$SCRIPT_DIR/web" && node build.mjs
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo "=== Building WASM ==="
|
echo "=== Building WASM ==="
|
||||||
"$SCRIPT_DIR/kobopatch-wasm/build.sh"
|
"$SCRIPT_DIR/kobopatch-wasm/build.sh"
|
||||||
|
|
||||||
|
|||||||
@@ -138,13 +138,17 @@ import JSZip from 'jszip';
|
|||||||
|
|
||||||
const stepHistory = [stepConnect];
|
const stepHistory = [stepConnect];
|
||||||
|
|
||||||
function pushStep(step) {
|
function showStep(step, push = true) {
|
||||||
|
for (const s of allSteps) {
|
||||||
|
s.hidden = (s !== step);
|
||||||
|
}
|
||||||
|
if (!push) return;
|
||||||
|
const idx = stepHistory.indexOf(step);
|
||||||
|
if (idx >= 0) {
|
||||||
|
stepHistory.length = idx + 1;
|
||||||
|
} else {
|
||||||
stepHistory.push(step);
|
stepHistory.push(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
function popStep() {
|
|
||||||
stepHistory.pop();
|
|
||||||
return stepHistory[stepHistory.length - 1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNavLabels(labels) {
|
function setNavLabels(labels) {
|
||||||
@@ -158,15 +162,6 @@ import JSZip from 'jszip';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showStep(step, updateHistory = true) {
|
|
||||||
for (const s of allSteps) {
|
|
||||||
s.hidden = (s !== step);
|
|
||||||
}
|
|
||||||
if (updateHistory) {
|
|
||||||
stepHistory[stepHistory.length - 1] = step;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNavStep(num) {
|
function setNavStep(num) {
|
||||||
const items = $qa('li', stepNav);
|
const items = $qa('li', stepNav);
|
||||||
items.forEach((li, i) => {
|
items.forEach((li, i) => {
|
||||||
@@ -704,12 +699,11 @@ import JSZip from 'jszip';
|
|||||||
}
|
}
|
||||||
populateSelectedPatchesList();
|
populateSelectedPatchesList();
|
||||||
setNavStep(4);
|
setNavStep(4);
|
||||||
showStep(stepFirmware);
|
showStep(stepFirmware, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
btnBuildBack.addEventListener('click', () => {
|
btnBuildBack.addEventListener('click', () => {
|
||||||
if (isRestore) {
|
if (isRestore) {
|
||||||
// Restore was triggered directly from the device step
|
|
||||||
isRestore = false;
|
isRestore = false;
|
||||||
setNavLabels(NAV_DEFAULT);
|
setNavLabels(NAV_DEFAULT);
|
||||||
setNavStep(1);
|
setNavStep(1);
|
||||||
@@ -836,7 +830,7 @@ import JSZip from 'jszip';
|
|||||||
}
|
}
|
||||||
|
|
||||||
btnBuild.addEventListener('click', async () => {
|
btnBuild.addEventListener('click', async () => {
|
||||||
showStep(stepBuilding);
|
showStep(stepBuilding, false);
|
||||||
buildLog.textContent = '';
|
buildLog.textContent = '';
|
||||||
buildProgress.textContent = 'Starting...';
|
buildProgress.textContent = 'Starting...';
|
||||||
$('build-wait-hint').textContent = isRestore
|
$('build-wait-hint').textContent = isRestore
|
||||||
@@ -909,7 +903,7 @@ import JSZip from 'jszip';
|
|||||||
errorLog.hidden = true;
|
errorLog.hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasBackStep = stepHistory[stepHistory.length - 1] === stepPatches;
|
const hasBackStep = stepHistory.includes(stepPatches);
|
||||||
if (hasBackStep) {
|
if (hasBackStep) {
|
||||||
errorTitle.textContent = 'The patch failed to apply';
|
errorTitle.textContent = 'The patch failed to apply';
|
||||||
errorHint.hidden = false;
|
errorHint.hidden = false;
|
||||||
@@ -922,16 +916,18 @@ import JSZip from 'jszip';
|
|||||||
btnRetry.classList.remove('danger');
|
btnRetry.classList.remove('danger');
|
||||||
}
|
}
|
||||||
hideNav();
|
hideNav();
|
||||||
pushStep(stepError);
|
showStep(stepError);
|
||||||
showStep(stepError, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
btnErrorBack.addEventListener('click', () => {
|
btnErrorBack.addEventListener('click', () => {
|
||||||
btnErrorBack.hidden = true;
|
btnErrorBack.hidden = true;
|
||||||
btnRetry.classList.remove('danger');
|
btnRetry.classList.remove('danger');
|
||||||
const prev = popStep();
|
stepHistory.pop();
|
||||||
|
while (stepHistory.length > 0 && stepHistory[stepHistory.length - 1] !== stepPatches) {
|
||||||
|
stepHistory.pop();
|
||||||
|
}
|
||||||
showNav();
|
showNav();
|
||||||
showStep(prev);
|
showStep(stepPatches);
|
||||||
});
|
});
|
||||||
|
|
||||||
btnRetry.addEventListener('click', () => {
|
btnRetry.addEventListener('click', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user